12-10-2020 08:15 PM
I'm having a problem with my Visa read functions getting the wrong data out of my Lake Shore 340.
It appears that the 340 will occassionally store previous commands such that if I send an IDN? command the response I get could be a temperature, set point, heater output, etc, from previous commands that I've already sent. So I can send it a command to read heater output but will receive the response for temperature or heater resistance.
If I repeatedly send it the same command enough times (like IDN?) it seems that I can get through all the previous commands so it give me the correct response for IDN? but it only reads an answer every other iteration.
I've never seen this kind of behavior before, and don't understand what is happening.
12-10-2020 08:33 PM
Sounds like data is left in your buffer from previous querries that were not properly read. I would need to examine code to make any more evaluations.
12-10-2020 10:06 PM
Thanks for your reply! That idea makes a lot of sense.
Unfortunately, due to policy reasons, I'm not sure if I'll be able to post my VI.
I appreciate any thoughts!
12-11-2020 01:27 AM - edited 12-11-2020 01:27 AM
Hi Nadweb,
@Nadweb wrote:
Briefly, I have teo horizontal sequence structures with specific read/write commands separated by 50ms wait functions. These are in a case structure that has a switch wired to it. …
I appreciate any thoughts!
Replace that flat sequences in cases of a case structure by a proper statemachine approach!
Send one command, read its response.
Send next command, read.
Wash, rinse, repeat…
12-21-2020 11:13 PM
Statemachines always trip me up if I'm being perfectly honest. I'm never know when to use them or what my different states should be.
I've done a lot of reading, but I'm still not sure what states I need for my application. I have one instrument I want to read temperatures from ever few seconds, nothing else (does this even need to be in the state machine?). The 340 I want to read a few different variables from in a particular order every few seconds, and occasionally (once a day maybe) I want to briefly stop reading data from it so I can write commands to it to change various settings, then I want it to go right back to reading the data every few seconds in a particular order. I write all the data to a spreadsheet.
As previously stated, I use a case structure and flat sequence structure to accomplish this (with occasional hiccups). How do I get started converting to a statemachine?
12-23-2020 12:05 AM
@GerdW
I did as you had explained and setup a statemachine, with different states being different commands and I can get the data i need and plot it on a chart, so that is some success.
I'd like to write the data from every state to a single spreadsheet but I'm not sure how to accomplish that. How do I gather all the data so I can write it to a spreadsheet?
Thank you for your help!