11-08-2010 06:07 AM - edited 11-08-2010 06:12 AM
That's great news 🙂 I'm glad it's finally working for you.
You can't determine when the "off" command will happen as this depends on when your processor schedules your thread. Essentially when you split the error wire, LabVIEW creates two threads to manage the task. It is then your processor that decides when to run these tasks.
It seems like you've already increased how many samples you read. Another possibility is to increase your sampling rate. Basically you will have to play with the numbers for your sampling rate and samples to read until you find the right combination.
Regards,
11-08-2010 10:30 AM
Now that i've put it into my main vi, it isn't working.
It comes up with a DAQmx error, see attached.
Thanks.
11-08-2010
10:56 AM
- last edited on
07-10-2024
09:13 AM
by
Content Cleaner
Here are a couple of reasons why you would get that error: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8kmSAC&l=en-US
Based on your code and this document you will need to figure out which reason is causing the error.
You may need to set up and clear your task outside of your loop (potentially main loop).
Let me know how you get on.
11-09-2010 05:54 AM
Ok, i've moved the setup and clear parts outside of the main loop, in order to refer to the connection in the subVI i have had to add a name to the create virtual connection box,
This happens before my main loop:
Then in a sub VI in a case structure in my main loop:
If i just run this it says: daqmx error the value passed to channels "Int" is invalid, this must be a valid channel or virtual task.
If i create a task called Int in automation explorer then it says "Int" is reserved.
11-10-2010 03:28 AM
There is no need to wire in your task ("int") to the Create Virtual Channel VI and your DAQmx Timing. Just wire them up exactly as before. Move your Create Virtual Channel VI outside of your loop.
11-10-2010 08:37 AM
I came across the attached picture today, thought you might find it useful too.
Hope it helps
11-11-2010 08:48 AM
Hi,
the first image (where i create the virtual channel) is outside the main loop.
With regard to teh "Int" name i have tried it with and without, with it it says DAQmx error "the resource int is reserved" without it it says "the resource unnabed channel(1) is reserved"
Cheers, Zac
11-11-2010 09:02 AM
- are you using channel 1 anywhere else in your code?
- do you have any other DAQmx sessions open in your code?
- are you closing down your communication channels with channel 1 properly?
- have you tried deleting the task int? (keep a back up of the settings before you do)
11-11-2010 09:20 AM
are you using channel 1 anywhere else in your code?
The virtual channel name that is created is not used elsewhere.
There was another task that refered to the same input pin but i removed it during de-bugging.
- do you have any other DAQmx sessions open in your code?
Yes, the following read occured 1 per second (or longer if user spesifies):
- are you closing down your communication channels with channel 1 properly?
i clear the task on program exit.
- have you tried deleting the task int? (keep a back up of the settings before you do)
Yes, if i dont use a named task but instead rely on it to creat a virtual task it comes back with the same error just saying "daqmq error the resource "unnamed channel" is reserved instead of saying "int" is reserved.
Thanks, Zac
11-11-2010 10:07 AM
Did you see the DAQmx programming picture that I sent you? Everything before the start task should be outside of your loop. Can you make this adjustment and send me a picture of it.
Can you also try techniques such as rebooting your pc or disconnecting the devices and reconnecting them again.
We know that particualr piece of code works so it's now just a case of integrating it within your project. Again it is good to run the code in highlight mode to see exactly what is causing the error. At the moment is the error occuring at the Create Virtual Channel vi?