02-03-2011 02:13 AM
I have a SCXI 1001. I am using a thermocouple module (1102, breakout box 1300), analogue input ( 2 off, 1100 card, 1300 breakout), analogue output (1124 card, 1325 breakout) and a relay card (1160 card, 1324 breakout). I am using labview 2009. I have set my channels up manually to read all of the channels I need onto 1 task for the thermocouple and analogue inputs, 1 task for analogue outputs and 1 task for relay output (3 tasks total). Each task contacts the SCXI box in a different section of a timed sequence. I read all of my channels accurately for about 30mins but then suddenly they stop reading accurately and all thermocouples read the same incorrect value along with all the analogue input channels. I am unable to change any of the output channels either.
The problem occurs quicker if I increase the clock rate. There are no errors showing when this problem occurs.
Is this a hardware interaction fault or a software fault.
Any help would be greatly appreciated. I also need to solve this quickly as it is delaying testing.
Thanks for your help
Tim
Solved! Go to Solution.
02-09-2011 11:15 AM
Hi Tim,
Can you post your code to the forum so I can take a look?
Regards
02-10-2011 03:40 AM
Thanks for your reply. I have attached my program. I read all the channels into the program in a subVI. All the subVi does is allocate a thermocouple channel with the name given on the cluster of Boolean arrays on the bottom left of the front screen (true false statements activated when the Boolean statement on the cluster is activated). I run this piece of equipment with a lot of different rigs which need different programs and settings so I use subVis to allow me to fundamentally change all the programs at once as the SCXI interface is the same for all of them. I also read in the calibration files for the analogue inputs to convert the voltage to a pressure or flowrate etc.
I think that the problem may be coming from the thermocouple module. If I run the program to read continuously (rather than to read a set number of samples per channel) the problem appears sooner. If you reset the thermocouple module (and then reset the error in the program) the values read correctly again. However if you reset any of the other modules the problem returns. Has anyone any experience of this happening? I am going to try and replace the module to see if that solves the problem this morning. Any comments on the code would be gratefully received. The thermocouple module is an 1102 and the breakout box is 1300.
It could also be the connection card which is connected into the back of the module (to connect the cable into from the computer).
Thanks for your help
Tim
03-07-2011 11:11 AM
WOW,
There is a lot of Love for the stacked sequence there!!!
A couple of programming Tips,
1) You have tried to divide parts of the code into sections that have different
Functions, This is Brilliant, and how we would expect coding to be done, but
why not use a subVI. So for example SQ1.3 can be made into a subVI as the whole
sequence builds a string for the write to file.
2) A Number of stacked sequences are just not necessary. You surround the whole code in a stacked sequence, why I’m not sure, as it does not add any extra functionality. The same for SQ 2.1.1.1.
3) Loop Pause timers – Add a wait milliseconds VI to the main loop. This will means that LabVIEW will release the processor at some point. Currently each loop will iterate as quickly as possible and hog as much of the processor as it can.
4) You can use the error cluster, (the yellow error carrying wire) to force the order of execution of your subVI’s.
5) Document your code – If only half the code sent in was documented this well it would make my job far, far easier!
Did the change of the Thermocouple module help?
Have a go at addressing the points raised and if we are still having issues then we can look in to them too.
Regards
03-08-2011 02:57 AM
Thank you all for your reply. I have managed to solve the problem. It was an issue with starting the task and linking the clocks for the separate tasks together. I only included one start task in the original code as multiple start tasks caused my code to be unstable. However, I have started my slave tasks (the analogue and digital outputs) before starting my master task (analougue inputs). This seems to have resolved the problem. I am intending to go further by adding clocks to the 2 slave atsks and linking them to the master task.
I have used the sequence as part of a documentation. Each sequence number links to another sheet which I have that has a flow diagram saying what each part does. As you say there is no need to put it in a sequence and to do so limits labviews own data flow. I will remove the sequences and put my code documentation into the code directly as it is done int he labview examples.
Thank you for your help
Tim