From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing the 1D array logic to NI DAQ output through port

Solved!
Go to solution

Hi,

I have implemented a logic and it gives the output as 1D array. I wanted to convert the one dimension array output to digital boolean logic output and interface it to Ni DAQ output port, so it could act as circular PRBS generator. Could you please let me know how to interface this 1D output to NI DAQ output port and make it as a function generator. 

 

Thanks

Ramesh B

 

0 Kudos
Message 1 of 10
(3,056 Views)

I think your central question is how to change a 1D Array of U8 to an equivalent 1D Array of Boolean.  I'm going to assume that you are representing True by 1, and False by 0.  Actually, a weaker assumption, 0 means False, and anything else means True.  

 

If my assumption of what you want to do is correct, it involves inputting an Array of U8 and outputting an Array of Boolean.  What LabVIEW Structure works most "naturally" with Arrays, particularly to process Elements one at a time?  What function can be used to take a number and return True unless it is 0?  That's what goes inside the For Loop.

 

Can you code this up yourself without one of us showing you how to do it?

 

Bob Schor

0 Kudos
Message 2 of 10
(3,020 Views)

Hi Bob,

First of all, I thank you very much for your help. I almost found out the logic. I have a query. I have single bit boolean data. I want to route this to NI USB 6211 output port, so it could be used for driving external circuitry. Can you please let me know how to do it. 

Thanks

Ramesh B 

0 Kudos
Message 3 of 10
(3,017 Views)

Hi Ramesh,

 

there's no boolean wire in your image. There's a blue integer wire going into an orange float indicator...

 

Hint: there's a whole palette with boolean functions and most comparisons result in boolean values.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,003 Views)

@rahb wrote:

I have single bit boolean data. I want to route this to NI USB 6211 output port, so it could be used for driving external circuitry. Can you please let me know how to do it. 

 


Hi, Ramesh.  It sounds to me like you have not yet been introduced to MAX and DAQmx.  MAX is NI's Measurement and Automation Explorer, and is used to "explore" your I/O device (here, your USB 6211), while DAQmx is the software routines and functions that allow LabVIEW (and you) to programmatically communicate.

 

There are excellent tutorials by NI on DAQmx -- just do a Web search for DAQmx Tutorials.  My advice would be to go through some of the Tutorials, then to plug in your 6211, open MAX, play with the Device to see that you can turn digital I/O bits on and off with a Boolean, and (if you run a wire from a Digital Out pin to a Digital In pin) can read (as well as write) Boolean (TTL) signals.

 

You may be tempted to try to use the DAQ Assistant.  If you are really interested in learning LabVIEW and how to build flexible I/O systems for acquiring data and controlling systems, I would avoid the Dreaded DAQ Assistant, and instead be sure to spend time with the Tutorial called "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications".

 

You should then be more than able to handle the questions you asked, and more.

 

Bob Schor

0 Kudos
Message 5 of 10
(2,994 Views)

Hi Ramesh,

 

I'm assuming you have array of data, which is integer but based on its value you want to control some output. you can index out and check its not equal to Zero(from Comparison Pallete) to get Boolean output.Attached snapshot for your reference.

 

Regards,

Venky

0 Kudos
Message 6 of 10
(2,988 Views)

Hi Bob,

I tried to do as you mentioned but I could not make it work. Let me summarize the issue. I am using NI USB 6211. I am trying to route the unsigned integer which transfers true or false to DAQ output pin. The logic is working fine and it is verified. When I routed and checked the output, the data is not displaying at output of DAQ. The figure is attached here as the reference.

Thanks

Ramesh B

0 Kudos
Message 7 of 10
(2,933 Views)

I will be happy to help, but you need to help me -- attach your VI, not a picture of a small part of your code.  Tell me how you configured your hardware -- if there are any parameters we should know about, explain what they are.

 

Bob Schor

0 Kudos
Message 8 of 10
(2,925 Views)

Hi Bob,

Thanks for your reply. I attached my sample VI here. I have three boolean data either True or false. But i am not able to display it in output of NI DAQ. 

When i observe output at port 1, line 0-4, i am not getting relevant results. 

Does this configuration is supported in NI USB 6211 device?

 

Thanks

Ramesh B

0 Kudos
Message 9 of 10
(2,912 Views)
Solution
Accepted by topic author rahb

Hi rahb,

 

you REALLY should implement some error handling!

Or atleast check the errors in your loop!

 

When i observe output at port 1, line 0-4, i am not getting relevant results. 

Line 0:4 would make 5 channels, but you only wired an array with 3 boolean elements.

In your VI you are using line 0:1, which is just 2 channels, but you wired an array of 3 boolean elements.

Neither your message here nor your VI makes sense with respect to channel count…

Again: implement error handling!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(2,906 Views)