08-27-2014 06:59 AM
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 ??
08-27-2014 07:24 AM
I'm not following. Please share some code.
08-27-2014 07:29 AM
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
08-27-2014 09:38 PM
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!!
08-27-2014 09:42 PM
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!!
08-27-2014 09:57 PM
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.
08-28-2014 01:52 AM
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 !
08-28-2014 02:21 AM
08-28-2014 02:35 AM
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
08-28-2014 07:03 AM
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.