07-06-2017 12:49 PM
I'm sorry, this is a little above me experience with LabVIEW. when using a property node how do I select the property? And will I need two Start, Read, and Stop task lines within the for loop?
Here is where I am now
07-06-2017 01:03 PM
To get the one like in the example you want to drop a "DAQmx Channel Property Node". You can probably browse for it as well, but this is easier. Then right click on it to make the inputs "write" and left click on the inputs to select the attributes you need.
07-06-2017 03:50 PM - edited 07-06-2017 03:51 PM
I made some quick mods to your code to do the task config more like I was trying to describe. I didn't pay real close attention to the formatting and file writing part so that might still need some work. Same with error handling. But see if the DAQ stuff works out to let you round-robin through your 8 signals.
Note: I don't know how you've configured your global channels. It's possible there is more work to be done either in physical wiring or designating correct pins in the task config.
-Kevin P
07-06-2017 04:41 PM
Thank you,
I am still getting an error:
Possible reason(s):
Value passed to the Task/Channels In control is invalid.
The value must refer to a valid task or valid virtual channels.
Task Name: Frequency_3
Not sure what it is asking for. I can do all the formatting afterwards but the channel switching are done .
07-07-2017 08:59 AM
Those Frequency_# global channels would be defined in MAX, I have no visibility to what was set up there. Below is a snippet to show how to do all the config on the block diagram, without involving any global channels or tasks from MAX. Note that the default terminal names I show may not be the correct ones for you to use. You'll have to make those terminals match the physical wiring you've done.
-Kevin P
07-07-2017 05:36 PM
Thanks for the suggestions on doing everything in the vi and not NI max
After fixing everything I am still having trouble getting my data to cycle through and print correctly. Right now it will only print one line of data for the whole time it runs. I need it to print the data from all the channels every second.
Here is the code:
I think it is getting tied up in the first for loop and/or the timed loop
07-07-2017 05:44 PM
Can you post the data you are getting? You can hook up an indicator to the iteration terminal "i" to see if it is running multiple times.
07-10-2017 12:01 PM
I would definitely recommend running in "Highlight Execution" mode (the lightbulb icon on the block diagram toggles it on & off). I'd also toggle the icon to its right, "Retain Wire Values".
My guess is that somewhere in the course of the For loop, at least one of the tasks produces a timeout error, which will terminate the loop after just 1 iteration. This can easily happen if any of the programmed terminal names don't match the actual location where the signals were physically wired. Double-check and make sure all these match up.
-Kevin P
07-24-2017 11:44 AM
I cannot upload any data, but on the timeout issue I notice that errors start in the for loop where it begins to read the channels. Is there a reason that this cannot be run simultaneously? I think that is the main issue, that one bank of channels is read before the other and the program shows a timeout error on the second bank while waiting for the first side to be read.
07-24-2017 02:28 PM
1. First verify that the error tunnel coming into the reading For loop has no error on it.
2. Then either probe or make an indicator for each of the arrays of errors coming out of the For loop via tunnels. This will identify exactly which one(s) of the 8 tasks produces an error and what it is.
In general, reading from two different Ctr Freq tasks in the same loop will not interfere with one another. They can operate in parallel just fine. I expect the error(s) you get are either due to a missing freq signal somewhere, possibly due to a mismatch between programmatic config and actual physical wiring config.
-Kevin P