LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting numerical control value to binary, and using this for NI-6509 Control

Hi all,

 

I want to do the following:

 

*Input a number using a numerical indicator

*Convert this number to binary

*Send in this binary number to a DAQ-Pad 6509

 

The DAQ Assist that I am using has 12 tasks, which selectively turn on/off ports in my DAQ-Pad. The way I am controlling this right now is that I am using an array of round LEDs as a control to tell the DAQ-Pad when to activate certain ports, but I would like to remove the LED control in place for a numerical control

 

I have so far been able to use number <==> boolean array to generate the binary states, but  when I try to integrate with the DAQ Assist, I get an error since the DAQ Assist has 12 tasks, but the boolean array provides 32 tasks. 

 

How can I fix this problem? Thanks!

 

David

0 Kudos
Message 1 of 4
(2,636 Views)
Try using the Array subset function on your Boolean Array of 32 elements to get an array of the 12 elements you are interested into send to the DAQ assistant.
0 Kudos
Message 2 of 4
(2,625 Views)

Hey David,

 

It sounds like you can convert your numeric value to a boolean array just fine, but when you try to use this array in your DAQ Assistant it throws an error. The error sounds like the DAQ Assistant is expecting an array of 12 elements. By default, the number control is an I32 data type. So, when converted to a boolean array, the array is 32 elements long. Try changing the numeric data type to something like I8 or U8 and see if the resulting 8 element array still generates an error. You can change the numeric data type by right-clicking and selecting Representation.

 

Hope this helps

 

-Ben

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 3 of 4
(2,613 Views)

Hi All!

 

Thanks for the inputs. After looking around, I found my own solution to the problem using fixed-point values. This method seems to work fine for me. Thanks once again Smiley Happy

 

David

0 Kudos
Message 4 of 4
(2,605 Views)