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: 

Use of Aligent 34970 for continuous monitoring and data logging of temperature

Hello,

 

I am using an Aligent 34970 to monitor and data several temperatures and record the temperatures to a spreadsheet. I have tried to use Loop 1 on this example and information from this example to write my data to a spreadsheet with a time stamp. I am using the instrument driver to communicate with the instrument. I have explored all of the examples included with this instrument driver. I have been most successful with the EZ Temperature.vi for getting temperatures from the device. I am hoping someone can help me solve issues with the attached program (Measure_Temp_EZ_Temp)

 

1. After completion of the program, the spreadsheet does not contain any data, except the initializing header and column names. Why is data not being recorded? I was able to get data to record when the write to spreadsheet function was inside the loop, but I thought it not best to keep opening and closing the spreadsheet, so I am trying to do it outside the loop, but now there is no data.

2. What would be the best way to apply calibration constants to the channels? I have noticed there is a Conf Scaling.vi in the instrument driver. Is this what should be used?

 

Finally, I tried to used the program illustrated by the Advanced Scan Example with help from this forum post, but I could not get the instrument to wait for the scan to be complete before scanning again, despite using the trigger and the ESR. *note this program does not contain write to spreadsheet function yet. Is this program better in terms of method of scanning the instrument than the one above using the EZ Temperature.vi and if yes, is there anyway to fix it?

 

Thank you!

 

Download All
0 Kudos
Message 1 of 8
(985 Views)

I wrote a nice long explanation on how to use this instrument a while back. It looks complicated at first glance but consider I was using two fully loaded 34970A units measuring AD/DC voltages and temperatures.

 

Re: Reading the number from a certain column in an running .CSV file

 

Look this over and try a few things, then come back with more questions.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 8
(963 Views)

Hello,

 

Thank you for connecting me to this other forum post. I have attempted to write my own program to closer match your example. But I have encountered a few errors when running the program. I also tried to make a state machine structure for the first time so sorry if there are errors I missed:

1. "Error 1: In Scan state: Error 1 on Find in String (arg 1) in Scan-now.vi, Possible causes: LabVIEW invalid input parameter. This path cannot contain characters like ? or @ that are not allowed in the respective operating system. The 'Scan from String' function in the Scan-now.vi is highlighted upon appearance of this error." I do not understand what is wrong with the input parameter as the Array # output is showing numerical values.

 

2. Error 2: "Error 7 when opening/creating/replacing a date in Write to xls file wit timestamp.vi. Possible causes: File not found. The file may be in a different location or may have been deleted. Verify the file path is correct." I have checked that the input file path is correct.

 

3. Finally, the numbers that appear in the array reading are not realistic. There are negative decimals whereas the I know the values should be ~20. I used the right configuration parameters for the thermocouples, so I do not understand why the numbers are wrong.

Download All
0 Kudos
Message 3 of 8
(932 Views)
  1. Mhmmm... that does not make sense to me but maybe it's related to 2
  2. That is because you did not wire your shift registers and after the very first iteration. The "Use Default if Unwired" sets your file path to the default "Empty path". You click on all your tunnels on the Case and check "Wire all unwired cases".smecCapture.PNG
  3. Thermal couples will read backwards if they are hooked up backwards. T type TC the Blue is positive and should connect to the high (H) side of the 34901 MUX module input. Also wildly varying thermocouple measurements is a sign of an open or intermittent thermocouple.
    1. Once every channel is configured on the 34970A you can press the "Mon" button and see live reading one channel at a time on the instrument display.
  4. Don't use the tick count or wait until next multiple to set your scan rate, make a "Timer" state so you can change it during runtime or abort if needed
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 8
(913 Views)

Hello,

 

Fixing the shift register solved #1,2. Thank you!

 

With regards to #3, I am confused because when using the EZ_Temperature.vi (which I now know is bad in terms of configuring the channels every time it is called!) that comes with the instrument driver, I was getting the right temperature values. The settings for this vi were T-type Thermocouple. The wiring was the same on the Agilent. I feel like there is something I am missing on the configuration. When using the monitoring button, the channels are now reading the very small negative decimals. Any thoughts?

 

With regards to #4, when you say a 'Timer' state, would this state follow the Scan state with a delay and then go back into the Scan state upon completion of the delay time? What type of function would go in this Timer state? A tick count where the value is compared with the scan rate which if true goes back into the scan state? Sorry, still trying to understand machine states and hoping this is on the right track!

0 Kudos
Message 5 of 8
(901 Views)

I did a few more tests since my most recent reply. On #3, I have noticed when I run the program without the loop using the Adv Scan example in the instrument driver folder, the temperature is correct (where only one scan is collected). Therefore, in my program I can confirm there is something wrong with the configuration, as if the configuration settings are not carrying over into the scan state. Maybe there is something wrong with the transition from the Setup state to the Scan state? I have noticed that the 'Current State' control on the front panel does not advance past the setup state. I have tried to check all the wires to ensure there is no reset, but I am not seeing what is wrong.

 

I would still appreciate your response on comments related to #4. I tried to put a wait until next function in the timer state and it worked, but I do not know if this is the correct method. I have attached the most recent VI.

 

Finally, I have noticed the outputted spreadsheet has all of the values in one excel cell per row. How do I get these into separate columns? I know this has something to do with the treatment of the array after scanning, but I am unsure of the right function to apply tot he array before feeding into the write to xls.vi.

 

So in summary, your help with:

1) configuration,

2) timer state, and

3) write to excel

would be greatly appreciated. I feel like I am very close and I have learned a great deal from the examples and help you have provided.

 

Thanks!

Download All
0 Kudos
Message 6 of 8
(880 Views)

If anyone has any suggestions about fixing the configuration of these thermocouples, that would be greatly appreciated. I do not know why the configuration is resetting.

 

Thanks!

0 Kudos
Message 7 of 8
(841 Views)

@hollyhue wrote:

If anyone has any suggestions about fixing the configuration of these thermocouples, that would be greatly appreciated. I do not know why the configuration is resetting.

 

Thanks!


After spending some time cleaning up your code, I don't see anything obviously wrong. So that makes me ask, why do you thing it is configured correctly in the first place?

- Generally good programming practice to close the VISA session when your done (in the STOP case)

- You do not need to build a 2D array, only to immediately index that array with a for loop.... which means you do not need the for loop at all.

- Current State was disconnected.

(to name a few.)

 

Frozen_0-1674228158470.png

 

I suggest coping the "set up" case and the "scan" case and put them into a new vi, and string them together. Once you get the run-once version working, then go back and fix the original code.

 

Good luck.

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 8 of 8
(830 Views)