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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to progrommatically check if cdaq chassis is in use

Solved!
Go to solution

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



-Matt
0 Kudos
Message 1 of 9
(3,200 Views)

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>   ---'


0 Kudos
Message 2 of 9
(3,192 Views)

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?



-Matt
0 Kudos
Message 3 of 9
(3,183 Views)
Solution
Accepted by topic author Wolleee

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>   ---'


0 Kudos
Message 4 of 9
(3,175 Views)

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.



-Matt
0 Kudos
Message 5 of 9
(3,163 Views)

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>   ---'


0 Kudos
Message 6 of 9
(3,155 Views)

Oh i Know too well.  Do you have an example of this application and how it would be used for a network cdaq?



-Matt
0 Kudos
Message 7 of 9
(3,147 Views)

@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>   ---'


0 Kudos
Message 8 of 9
(3,113 Views)

That sounds simple enough, but well see.  Im going to give that a whirl tomorrow.  THanks for the all the help.



-Matt
0 Kudos
Message 9 of 9
(3,102 Views)