07-19-2024 07:44 AM
Hello, first time swiched from GPIB instruments to COMport instrument. I'm strugling to understand how to set it to work properly. Wached hours of serial port labView tutorials. Went through dozen of tutorials can not find the problem.
I've connected instrument to USB -> com port. I'm sending a command "freq". Got the right feedback from instrument, but with timeout.
If I Enable Terminaton Char in VISA configure serial port, i receive just the first line.
"SPECTRUM COMPACT HARDWARE 6.10, FIRMWARE 5.3.10.2, 07.11.2023 11:21"
Is there anything I can do to receive all the data with single VISA Read?
Solved! Go to Solution.
07-19-2024 08:13 AM
I generally don't like doing this, but you could use > (62, 0x3E) as your termination character. This will work as long as that character is never in one of the responses.
My preference is to constantly try to read the lines and use a queue to pass the data on to the main loop. That reading loop also logs every single read line to a file for debugging. This is all part of a terminal framework I put together.
07-19-2024 10:06 AM
Thank you for hints!!!
Why is " > (62, 0x3E)" this better termination character than others? Please drop some links, will study it!
For sure, I can manipulate with instrument using putty or Termite, but I've stucked also to trigger the instrument to start measurement with LabView. For example,
sweepu 27000000 40000000 250 khz
in Termite triggers the measurement according to user manual. But in my .vi it kind a blinks display for a second and measurement is not trigered. Where is the problem in my .vi why instrument do not trigger?
In Termite I realised that measurement on instrument is trigered just in case if Append CR is used. All other options gives the identical result as my .vi
I got so much litters of coffee in my body today... will continue with beer 😄
07-19-2024 11:10 AM
@ku_ku wrote:
Why is " > (62, 0x3E)" this better termination character than others? Please drop some links, will study it!
I stated to use '>' based on your previous image where it was obviously a terminal that used "->" for the prompt. So '>' would indicate when the device was done sending something. But with your update here, I would go back to my base of using the Carriage Return or Line Feed at the termination character and use a queue to send each line to the main loop for processing.
07-19-2024 11:22 AM
07-19-2024 11:28 AM
@ku_ku wrote:
your video, rigt?
https://www.youtube.com/watch?v=J8zw0sS6i1c
Yep, that's me.
07-20-2024 10:32 AM
Hello,
is there a possibility that after the last symbol sent from the instrument ">" there is no termination character???
If I try to read all data, that is sent by instrument, while Termination character is disabled, I run in timeout... but I got the data!!! Identical to what I get with Termite.
But when I enable termination character and read line by line, as you suggested, I also get all the data, but I got timeout while the last "->" is read!I guess there is no termination character after "->". How to test it?
If there is no Termination character, is there a workaround?
07-20-2024 11:03 AM - edited 07-20-2024 11:04 AM
To save time, please share the instrument's make and model or, better yet, the programming manual.
07-20-2024 11:29 AM
Hi Santo,
I'm glad to share it 🙂
SpectrumCompact (J0SSAP74)
Hope you can see there something I do not see 🙂
07-20-2024 07:39 PM
@ku_ku wrote:is there a possibility that after the last symbol sent from the instrument ">" there is no termination character???
That is normal for a terminal. It is the command prompt. I treat a terminal as an "Intermittent ASCII" instrument (referring to my presentation you linked to). I use Bytes At Port to see if there is a message started. If there is, read the line. If not, maybe have a wait. With this, I set the timeout to something pretty short, like 50ms. I will then ignore the timeout error (Clear Error has an input for specific errors to clear) and just treat what I did receive as a full line.