Converting To and From Bit() for 32 bits variable


Recommended Posts

I have a variable that is a 32 bits integer.    I want to convert it to a 32 bits binary value and displayed on screen using To.Bit() expression on a variable display component.  But it returns only showing maximum 20 bits like {(0,0,1,0........}} .   

I also tried using From.Bit(B00,B01,B02, ........, B31),  it failed. I can only use From.Bit(B01,B02,B03, ......B19) to convert maximum 20 bits only.  

I read the manual section 4.12.10 on page 74-76 regarding the Bit() conversion expressions. It mentioned to convert 32 bits variable.  So why my expression can only convert for 20 bits value? How to convert to or from 32 bits variable?

 

Link to comment
Share on other sites

To avoid bogging down your system by accidentally specifying a big array, DAQFactory will only display the first 20 values in any array.  So if you do:

myChannel

instead of 

myChannel[0]

you'll only get the first 20 values of myChannel, not the entire history, which would chew up a lot of CPU time to display, over and over again.

So, you are running up against this.  What you'll have to do is display two sets of 16:

(To.Bit(x))[0][0,15] 

and

(To.Bit(x))[0][16,31]

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.