06-20-2022 03:10 PM
Hi,
I want to read temperature data and input setpoint from/to a temperature calibrator (Fluke 9100s). The device has interface commands that can be used to perform these tasks. I would like to know what function, block or set of functions i should use to send these commands to the device to read the temperature and input setpoints.
I have created two Labview VI, which is both kinda the same, and i am attaching it here to get suggestions, and insights. I know the device and the VI is communicating as I am seeing some weird characters appear during runtime in the output.
Alternatively, is there a method by which i can convert these weird characters possibly into a meaningful result. I could doing something teriblly wrong here too. Would like to know what i am doing wrong here and get some insight into this. Please help me solve this problem.
Attaching all the VI's, Manufacturer interface command pages, and runtime results of the VI.
Thanks,
themadgreek
Solved! Go to Solution.
06-20-2022 06:52 PM
1. DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)
The VISA Reads until the number of bytes you told it to read are read or the termination character is read. So you need to set the Termination Character to a Carriage Return (0x13) and just tell the VISA Read to read more bytes than you ever expect in a response. This way you will know you got a complete message.
2. I highly recommend you go watch this video: VIWeek 2020/Proper way to communicate over serial
06-21-2022 03:36 PM - edited 06-21-2022 03:41 PM
@crossrulz wrote:
1. DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)
I think I have seen this before 😁
And here
And here
I wonder how many times this has been stated on these forums?
06-21-2022 05:01 PM
@Frozen wrote:
@crossrulz wrote:
1. DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)
I think I have seen this before 😁
And here
And here
I wonder how many times this has been stated on these forums?
I have it as a forum macro for a reason...It is also the reason I presented on proper serial port communications, whose link I also turned into a macro.
06-22-2022 04:31 PM
Hi @Crossrulz,
Thanks for writing here, and being part of the discussion. It was good knowledge from the your video. I'm still pretty new to all this cool stuff, so my understanding and knowledge is limited. So based on your recommendation i made changes to the Vi and i still cant seem to have it work. I am attaching the vi here, could you let me know what i am doing wrong here? Also, please let me know of any suggestions and recommendations you have for me.
Thanks
themadgreek
06-23-2022 06:41 AM
A few thoughts...
1. Change all of your settings controls into constants. You appear to have the wrong default termination character (should be 13, 0xD). Setting these things into constants helps remove ambiguity for those who are trying to figure out your code.
2. You likely do not have the termination character in your "write buffer". So concatenate the End Of Line constant to your write buffer before the VISA Write. I would go so far as to create a VI that does this for you so you can reuse it (see #3).
3. You should create a VI for each command/query you want to perform with this device. You can then use constants and remove ambiguity.
4. Once you have that done, you can use an Event Structure to detect value changes (set point value, buttons, etc.) and call the VIs you just made. This will make things a lot easier on you as the user.
06-24-2022 04:12 PM
Hi @crossrulz,
Thanks for the thoughts and suggestions. Based on your recommendations I re-worked the Vi to the best of my understanding, and now its working. There is still some rectifications to be done, as the buffer holds the previous values and some of the commands doesn't seem to work or no results in the read buffer. But I'm able to read and input setpoint temperature values, change units etc.
I'm attaching the draft VI (that kinda worked for me) here for any suggestions, recommendations or for anyone who had the same problems as I had.
Note: This VI is not the final code to execute all the commands for the Fluke 9100S temperature calibrator. I'm working on it.
Thanks,
themadgreek
06-24-2022 09:55 PM
I cleaned up your VI.
As far as the buffer still holding values, you could add a button to just perform a read.