LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unitialized shift register loses all data

Hello,

I am using a compactRIO system for in-vehicle data logging and control. The Time Critical Loop (TCL) on the compactRIO stores all sensor calibration settings and control gains etc in a large cluster that is stored in an unitialized shift register.

When the cRIO is turned off and then restarted I expect the calibration settings to remain in the unitialized shift register but they do not. Instead they must be reloaded via the host PC after every system restart.

This is not a problem that I used to have when I was using Labview 7.1, could it be that something has changed when I upgraded to LabView 8.2 and all of the most recent cRIO drivers??

Many thanks
Richard


0 Kudos
Message 1 of 8
(3,570 Views)
Hi Richard,

I'm wondering if your application is set to boot on startup on the cRIO controller. With a desktop PC I know that shift registers can be used to retain information on repeat "runs" of an application in the development environment, but if one was to exit LabVIEW and relaunch their application it will not retain values. Also, if one was to power cycle their PC shift registers won't retain their values. Have you got any of the dip switches set in the on state on the controller?

My intentions are to have an attempt to see if there are any differences with 7.1 and 8.20 with the cRIO controller we have in the dept. I'm not in the office tomorrow mon 20th. I shall let you know of the outcome asap.

All the best!

Kind Regards,

Kurt
NI UK Applications Engineer

Message Edited by Kurt NI AE on 11-19-2006 05:47 PM

0 Kudos
Message 2 of 8
(3,502 Views)
Hi Kurt,

Thankyou for looking into this problem I would be very interested to hear what you can find out.
I did have my application set to run automatically on startup, and all dip switches were in the off position.

best regards
Richard
0 Kudos
Message 3 of 8
(3,481 Views)

Hi Richard,

 

If your VI has a loop that uses an un-initialised shift register then it will retain values for repeat ‘runs’ of the application. i.e. if you programmatically stop the VI and then run it again then on this execution it will still have the values in the shift register. However if you power cycle (switch off and back on again) the cRIO then the VI running on the controller will not retain values in the un-initialised shift registers. There isn’t a difference between LV 7.1 and 8.20 with this behaviour. Can you attach your VI to the discussion forum for me to appreciate the problem further?

 

Perhaps you could set things up programmatically so that the last value from the shift register could be logged to a file (that would reside on the cRIO) that can be read back to give shift register such a starting point when the VI boots on start-up?

 

Kurt

Applications Engineer NIUK

0 Kudos
Message 4 of 8
(3,446 Views)

Kurt, Richard, et al,

I agree with the theory or Kurt's reponse but there was a bug in either 7.0 or 7.1 where the contents of a shift register could work its way back into the code ON DISK. At the time we joked about it being "self-modified code".

So there is a possibility Richards code was taking advantage of this bug.

Trying to help,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 8
(3,440 Views)
From what I have read, the problem seems to be with LV 8.20 code and not LV 7.x so don't think this is the same issue.

Is it possible to post some 8.20 code that shows this behaviour?

If this is causing you a problem, why not initialise the shift registers on start-up with the data that was last written to them. For example, at the end of your execution, write the shift register values to user memory on the FPGA and before start-up again, read these values back again. Would this work for you?

Still, feel free to post code if required.
0 Kudos
Message 6 of 8
(3,420 Views)
Hi Kurt and Ben and SR,

I now use an initialised shift register set up to read from disk on startup and to save to disk when the loop is programmatically stopped. See attatched diagram for what is happening now (i have removed all of the other code for simplicity). This does work quite well but I could get the same effect in 7.1 with an uninitialized shift register, perhaps as Ben suggests I was taking advantage of a bug I didn't even know about.
The only problem now is that for a settings change to be saved I must programatically stop the vi. Is there an easy way I can trigger the vi to save the information in the shift register while the vi is still running, without introducing non-deterministic file saving operations into my time critical loop?

Best regards,
Richard

Message Edited by RichE on 11-21-2006 10:37 AM

0 Kudos
Message 7 of 8
(3,409 Views)
Apologies Ben, I misread your posting 😉
0 Kudos
Message 8 of 8
(3,400 Views)