Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from instrument with COM serial port

Solved!
Go to solution

@ku_ku wrote:

Hi Santo,

               I'm glad to share it 🙂

 

SpectrumCompact (J0SSAP74)

Hope you can see there something I do not see 🙂

 

 


Tim (@crossrulz) has already provided all the right guidance.

Looks like the manufacturer did not make the instrument's API "automation" friendly, typical SCPI commands are very automation friendly as it doesn't treat the computer as an extended display (i.e., terminal) to the instrument.

What I observe is that whenever the instrument sends "->" it is expecting the computer to send a command or query something, all other time it is sending some data. So, you need a state machine like architecture, where it looks for the "->" output from the instrument and only then it can command/query something.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 11 of 14
(132 Views)

Thank you for your help!

 

Got more questions than in the beginning... but I have more or less VI tool that can log Spectrum Compact measurements once in minute.

 

I'll share basic .vi that can read 39-40GHz spectrum. There are still lot of to tune and optimize.

 

One thing I don't like now, is reading data- line by line (LF delimiter), in stead of all data in one set  or two-three sets(CR delimiter). If read line by line there is more than 4002 lines to read. Time delay 1ms is quite on the edge. If data is not read and next sweep has been started, then "communication hangs".

 

Lot of to do, but for sure, it will help me to work in field. Log measurements for 24h, without sitting down and pressing the buttons on instrument.

 

 

 

0 Kudos
Message 12 of 14
(115 Views)

How to convert sring of "hexadecimal unsigned byte strings consisting of 2 characters" delimited by LF to ASCII delimited by LF? Can not figure it out. 

 

This is in hex code

ku_ku_0-1721635508561.png 

 

transform it to string (decimal number)

 

101

101

100

102

 

I can do it line by line, if I read an instrument line by line. But instrument spits out 4001 line in one string... no ideas 🙂

0 Kudos
Message 13 of 14
(94 Views)

Got the answer... still it is not string with ASCII decimal numbers at the output, but I can deal with array... or convert to string :D:D:D

 

ku_ku_0-1721642956905.png

https://forums.ni.com/t5/LabVIEW/how-to-split-a-hexadecimal-string-into-the-required-components/td-p...

0 Kudos
Message 14 of 14
(87 Views)