LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Restarting Task After Performing Shunt Calibration

Hi,

 

I wonder if anyone can help with a problem that I am having with LabVIEW 8.5. I am using LabVIEW to measure strain gauges via SCXI 1520 signal conditioning units.


To perform a shunt calibration of the gauges I use the National Instruments example code.  The problem seems to occur after the  'CalculateGainAdjust.vi' has been called. The DAQ task is passed to the calibration code, 'CalculateGainAdjust.vi' does the following:

 

*passes the clock configuration to the end of the VI so the original state can be restored.

*enables shunt calibration

*creates a new clock

*starts task

*reads 1000 samples

*stops task

*disables shunt calibration

*restores task state

 

This code executes without causing an error. If the main DAQ task is stopped and then a calibration performed the task will not restart with its original configuration and times out with the following error:

 

Error -200284

 

DAQmx Read (Analog 1D Wfm NChan NSamp).vi:11<append>
<B>Property: </B>RelativeTo
<B>Corresponding Value: </B>Current Read Position

<B>Property: </B>Offset
<B>Corresponding Value: </B>

 

If a calibration is performed before the DAQ task is started then the DAQ task starts ok after calibration.  It is only if the task is run then stopped to perform a calibration that the problem occurs.

 

Is it necessary to take into account the 1000 samples read during the calibration process? I wonder if the main DAQmx Read VI is waiting for the 1000 samples that have been already read ? Strangely enough I don't think this was an issue when the code was run on LabVIEW 8.2

 

Any suggestions would be appriciated

 

Kind Regards

 

Ian

0 Kudos
Message 1 of 7
(4,182 Views)

Hello Ian,

 

I would like to help you with your query regarding the SCXI 1520 and calibration using the shunt resistor.  You mention that you are using LabVIEW 8.5, and an example VI. 

 

Could you name the Example Code you are using, and where you found this on the Example Finder, or online?  I could then follow through the steps as you describe them.

 

As for the error you are seeing, -200284, it is typically associated with a DAQmx task not acquiring the number of samples specified in the timeout time set in the block diagram.  The can usually be fixed by changing the rate, or ensuring that the DAQmx Read.vi is being triggered correctly.  However, I can narrow down a solution based your reply of which code you are using.

 

Regards,

 

 

George T.
Senior Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 2 of 7
(4,143 Views)

Hi George,

 

Thank you for the quick reply.

 

The code I am using can be found here:

 

http://zone.ni.com/devzone/cda/epd/p/id/3413

 

It is contained in the 'SCXI ShuntCalChannels' library.  I have found an article which describes the various causes for the 200284 error and I am going to investigate the clock settings and trigger settings.

 

What I find quite curious is that if you perform a shunt calibration (which takes the DAQ task, modifies it and then returns it to its original state) and the task will still start when the main acquisition code triggers it (this is done from the hardware via a PFI line).  If the acquisition has been run then stopped and a shunt calibration performed then although the calibration is successful the DAQ task just times out when the start command is given again.

 

Are there any other VIs or methods which can be used to do shunt calibration ? The code was initially used when LabVIEW 7 was the current release.

 

Kind Regards

 

Ian

0 Kudos
Message 3 of 7
(4,137 Views)

Hello Ian,

 

Thank you for the link pointing to the downloaded examples that you have been using.  More importantly, I am also glad to see that you are able to use the examples and that you found an order of operation that does not cause any error codes.  You are, however, interested in continuing searching to find what causes the error in the latter case of operation, which is what I will be helping with. 

 

Just to be sure, I have a Knowledgebase Article linked below to help avoid the error, -200284. 

http://digital.ni.com/public.nsf/allkb/FEF778AD990D5BD886256DD700770103?OpenDocument

 

As we said, the error can occur in the latter case because something is not being setup correctly with the DAQmx task, or because the Calibration procedure is making use of the the hardware resource, and not releasing it for the DAQmx task.  I will have to do more research, and reply back confirming the cause.

 

The examples you are using seem to be the most current, although I will take the time to compare them with those that ship with LabVIEW 8.5, which you currently have.  The examples have been available since the release of the modules.  As the modules have not changed, it appears that examples are at their optimum level.

 

Regards,

George T.
Senior Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 4 of 7
(4,118 Views)

Hello Ian,

 

I have looked at the examples you were using, downloaded from the NI website.  Have you been using and experiencing trouble with the VI 'Cont Acq Strain Samples (with Calibration)_select_chans.vi', or has it been operating correctly?

 

From your previous post it sounds like you were using some of the VI's found in the libraries, such as 'SCXI Shunt Cal Channels.llb' to create a custom DAQmx task including the calibration for the SCXI 1520.  If this is the case, I can help you further if you attach your custom VI to your next post, or to attach a screenshot of your block diagram. 

 

Have you also tried running your failing VI with 'Highlight Execution' switched on, to see at which point the Error Message is generated?

 

I will await your reply before moving forward.

 

Regards,

George T.
Senior Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 5 of 7
(4,102 Views)

Hi George,

 

I haven't tried running  'Cont Acq Strain Samples (with Calibration)_select_chans.vi' the VI I have been using is called 'subSCXI Shunt Cal Channels.vi'  which is part of the examples code you have.

 

I have attached a JPEG of the relevant part of the calibration code. I can send you the source code if you like, as there are a number of files it might be more convientent if I zip them up and email them to you.

 

The error mesage is generated after calling 'DAQmx Read.vi'. after it has failed to read the required samples and the time out period has expired (128 strain channels at 10 samples/second and the time out period is 20s) 

 

Thank you for your help

 

Kind Regards

 

Ian

 

 

 

 

0 Kudos
Message 6 of 7
(4,089 Views)

Hello Ian,

 

I have been looking at your screenshot, and relating the data you are passing to the Example VI that you have incorporated.  If you follow through the Sub VI's of the example code, you see that the DAQmx tasks and channel names are altered for the purpose of calibration.  Based on the error code you have been receiving I feel that the DAQmx task is being altered somewhere else in your VI as well. 

 

It would be helpful to see your VI. Please Zip your main VI and its dependencies, and post it as an attachment on the forum.  I can then review the Main VI, and all the actions taking place in your Stacked Sequence Structure, which at this point is hiding my visibility of your Block Diagram.  Also, please state whether the code you are sending is the code that is causing the error. 

 

Regards,

George

George T.
Senior Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 7 of 7
(4,041 Views)