LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW error -200324 handling

I am using a USB-6259 with LV2010, and have written an application to control a test stand.  There are times when power to the stand is removed, and therefore also power to the DAQ board, causing error -200324.  With LV running on a laptop with a battery, I keep the LV program running.  When power is restored, the continue button in the error display window can be pressed, and the LV code begins executing again.  My issue is that the stand is in the state at which power is lost, which places the test stand in an unsafe condition upon resuming.  I need to have LV recognize the error code and place the test stand in a safe condition prior to power restoration/continuing code execution.  Can the error be trapped (error cluster read) and acted upon, or is there another way to check the state of the DAQ device to perform the necessary actions?  Thanks in advance!

0 Kudos
Message 1 of 9
(5,454 Views)

I also noticed error -201003 when the LV program was started while the DAQ device was not powered on.  I would like to trap this error as well.  Any way I can read these error codes in the VI and programmatically act on them?  Thanks in advance.

0 Kudos
Message 2 of 9
(5,427 Views)

Turbosaurus,

 

You can use the Unbundle By Name block to retrieve a boolean error status and integer error code.  These can be used with case structure(s) to preform certain actions when errors occur.

 

Regards,

 

Sam K

Applications Engineer

National Instruments

www.ni.com/support

0 Kudos
Message 3 of 9
(5,420 Views)

Thanks for the reply.  Yes, I have used that technique for DAQmx tasks (AI, AO, DI, DO...) but where is the error cluster to unbundle for the above errors?  Are they available on the error cluster from one of my DAQmx I/O tasks, or some internal error?  Thanks in advance.

0 Kudos
Message 4 of 9
(5,414 Views)

If you need to know when power is off then restored, you really need a more reliable method to determine the status of your power.

 

Have a relay that is driven by your power.  When power is on, relay is on, power off-relay off.  Use that relay to control a digital input into your DAQ board.

 

Why are you losing power to the DAQ board if it is plugged into your laptop running on a battery?

 

If you are using a UPS, or even your laptop, you can monitor the state of the battery by using a utility VI at this link. Calculating the System Power Source and Battery Information in LabVIEW

0 Kudos
Message 5 of 9
(5,403 Views)

This test stand was built before I was called in to code LV, including powering the USB-6259 off of test stand power.  Changing this hardware setup will be next to impossible, unless I can prove it to be a significant safety issue.  The DAQ can therefore lose power while the laptop & LV program do not.  Can't read a relay/DI with DAQ powered off, so I want to read LV error -200324 and/or -201003 to determine if DAQ has been depowered, and gracefully shut down LV program.  My question is really, if an error code is generated without an associated DAQmx task (no task number appears in the error message) where is the error generated, and can I tap into that error cluster to read codes/booleans and set LV cases.  Any thoughts?

0 Kudos
Message 6 of 9
(5,397 Views)

I don't understand how a USB device can be powered by something else besides the USB bus coming from the PC, but that is besides the point of your question.  I was just trying to say that there should be a better more reliable way to determine the presence or absence of power.  But if you can't change what was a poorly designed system, then I guess your stuck with the error codes.

 

You can connect an unbundle or unbundle by name to the error wire coming out of the DAQ function and read whether it is an error, the code number, and the string data of the error.

0 Kudos
Message 7 of 9
(5,385 Views)

The USB-6259 requires a 24v power supply. It is not powered with the USB port. 

 

I ran a test case, and the DAQmx tasks created for analog and digital I/O do pick up the error codes listed above, and I will be able to use them to take the required action. 

 

Thanks for the tip on the laptop battery power monitoring vi, as I have been concerned about long term testing unattended with a power supply accidentally removed from the laptop running LV. 

0 Kudos
Message 8 of 9
(5,374 Views)

I'm pretty sure on a USB-6259 you can set power-up states for the digital ports. Easiest way is using MAX and going to the attributes tab.

 

I would probably go for trapping this error and then polling the device by attempting to restart the task until it wakes back up and doesn't transmit the error.

 

Probably not possible in your case, but for test rigs that need to run unattended we use external watchdog circuits to make sure everything is safe. The watchdog circuit receives a low frequency digital pulse generated by the VI using a digital out on the DAQ. If the VI stops working or the power to the DAQ fails the watchdog drops all the power lines. In that way you can make sure the DAQ is in a safe state before restarting the watchdog signal and bringing the power back on in a situation like the one you describe. An external physical E-Stop button is always connected into the same circuit so an operator can also disable the rig in an emergency.

 

Not sure if this helps, but you never know.

 

Paul

Regards

Paul

CLD running LabVIEW 2012 32 & 64 bit on Windows 7 64 bit OS.
0 Kudos
Message 9 of 9
(5,344 Views)