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.
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.
06-18-2015 10:53 AM
Hi all,
Im writing a program that will reserve a cdaq chassis, but i want to know if the daq is in use before taking control of it. Can this be done in the code?
Thank you
Solved! Go to Solution.
06-18-2015 12:03 PM
What type of cDAQ is it?
If it's a network cDAQ, then you have to reserve it in order to connect in the first place. Then, if you try to reserve it when it's already been reserved somewhere else, you'll get an error.
If it's a USB cDAQ, then when you try to start a DAQmx task with a module already being used, it will error out there.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-18-2015 12:40 PM
Sorry,
should have stated that, but yes it is a network cdaq, what i would to know is it if is in use, i assume it will always be reserved, but now im thinking that i will actually unreserve it at the end of every application and that way i can tell it to not reserve if it is already reserved. But is there a way to tell if it is being used versus reserved?
06-18-2015 12:51 PM - edited 06-18-2015 12:54 PM
The purpose of reserving is to block out all other communication with the device and allow the reserving computer to have full access. I would suggest you just unreserve it when it's not in use, thus allowing other connections to take over.
Seperate from the cDAQ chassis, if you have multiple computers on the same network as I assume you do, you could have network published variables that tell the other network computers if the chassis is in use. This is pretty much a a work around to be able to know if the chassis is in use vs not in use regardless of the reservation.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-18-2015 01:09 PM
Well it seems it may be a bit of a learning curve, but that may just be what im looking for. I dont always run all the tests around here so i wanna make sure it fool proof. Thank you.
06-18-2015 01:17 PM
Good luck!
Making a test run is one thing. Making a test run when grunts get their hands on it is another thing that takes a lot of foolproofing.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-18-2015 01:35 PM
Oh i Know too well. Do you have an example of this application and how it would be used for a network cdaq?
06-18-2015 06:57 PM
@matt198717 wrote:
Oh i Know too well. Do you have an example of this application and how it would be used for a network cdaq?
Oops, forgot to respond to this.
Just a single boolean shared variable should do the trick for you. What I would do is have a variable named "cDAQ in Use?" and each time an application begins using the cDAQ, it writes a value of True to the variable and False when it's done. Another application that might want to connect to the cDAQ and wants to know if its in use can read from the Shared Variable to see what's going on.
If you don't plan on having a ton of variables, they're really easy to use just like a Global Variables. If you end up with a lot of them, though, it can get hectic so it's best to organize them better at that point. For now, check out the example "Shared Variable.lvproj" by going to Help > Find Examples... in LabVIEW.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-18-2015 07:22 PM
That sounds simple enough, but well see. Im going to give that a whirl tomorrow. THanks for the all the help.