LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

compare daqmx event with dynamic data

Good evening everyone!

Our project is now facing a problem with LabView.

 

For our project, we need to use daq to acquire current for our SOC. We want to use virtual channel so people can choose channels from the front panel directly. But when use DAQmx Virtual Channel, the task out is daqmx event which can be used for further calculation like multiple times to get our SOC, also can not compare with a constant.

 

Could anybody help me  with this question? How can I extract the value inside the task out for DAQmx or convert daqmx event to dynamic data directly  ??

0 Kudos
Message 1 of 10
(4,293 Views)

I'm not following.  Please share some code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(4,285 Views)

I think you mess up some things, esp. terminology.

Did you already check the provided DAQmx examples in the example finder? They should answer your question....

 

Regarding terminology: Please review DAQ tutorials and white papers to get familiar with the terms used. Only using the correct terms will enable other forum-visitors to understand your request.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 10
(4,281 Views)

Ohhh hi!!! crossrulz~~~

The code is attached here, I try to replace my DAQ with the DAQmx Virtual Channel.

 

Also, I try to put 2 programs in same vi. but I failed...Could give me some suggestions??

Thank you!!

0 Kudos
Message 4 of 10
(4,252 Views)

Hi Norbert_B, I attach my vi here you can see.

 

I want to compare my value get from DAQmx Virtual Channel (I/P) with a constant. If the limitation is meeted, my O/P should generate a constant voltage to control a relay.

But these are two types of data, one is DAQmx event and one is dynamic data...so there get an error...

 

Thank you for you kindly help!!

0 Kudos
Message 5 of 10
(4,251 Views)

You are comparing a DAQ task reference with a number ????

 

You need to move the Create Task for the I/P channel outside the loop.  Since it is called "I/P", I assume that means input.  You need to make that an analog input voltage task rather than an analog output voltage task.

 

Then you need to actually READ the analog input channel.

 

Please look at examples for DAQmx in the example finder and study them.

0 Kudos
Message 6 of 10
(4,246 Views)

Hello RavensFan, I did read the example for DAQmx, but both of them don't show how to do if I want to use the value get from DAQmx Virtual Channel for further calculation...

And I have changed the DAQmx to analog input voltage task.

 

Can extract value from the DAQmx Virtual Channel I/P or convert it to dynamic data??

Thank you !

0 Kudos
Message 7 of 10
(4,232 Views)
Don't ever use dynamic data. Convert to a real data type though the regular DAQmx Read should return either a waveform, dbl array or scalar. You then have decide what sort of comparison to do. For a waveform or dbl array, do you want to take the mean and then compare? It all depends on your read and whether you take multiple samples or not. After that, you just need to use the comparison function you want.
0 Kudos
Message 8 of 10
(4,225 Views)

First and more important: There are MANY more examples for DAQmx Analog Input (AI) than two. I don't know why you talk about "both of them" as it should be "all of them" or "the one i opened"....

 

Yes, you are correct that the examples always create the virtual channel directly. The point is that this does not require the user to pre-configure the virtual channel using NI MAX.

So in your case, you would simply replace the "DAQmx Create Virtual Channel.vi" (including the parameters) with a control "DAQmx Global Channel" you can find in the "Modern >> IO >> DAQmx Name Controls" palette.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 10
(4,220 Views)

So you changed your DAQ Assistant to attempt to use the DAQmx API.  Normally, I would say "Good for you".  But if the code was working, why change it?

 

Mimic what I did with the Analog Output.  See how I configured before the loop, wrote inside the loop, and closed after the loop?  You should do the same thing with the Analog Input, except you do a DAQmx Read instead of a write.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 10
(4,202 Views)