LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SCPI command check

Solved!
Go to solution

Dear NI community,

 

I am very new to LabView and SCPI commands. As part pf my work, I want to send SCPI commands in LV in order to communicate with Gaussmeter IGM11 to do the Magnet flux  Measurement. 

 

I read the IGM11 manual already  to get the basic idea of the scpi commands. Using ethernet (LAN) I have established a connection between Gaussmeter and PC. Through RS-232 I need to send SCPI commands to communicate with the device. Using TCP I would like to communicate with the device. I have connect the labview to gaussmeter but its not showing any data values in the labview program. Even I have little doubt about the code, I dont know whether the code is correct or not. Could you please tell me the way I have implemented the code is right?!

and I need to get continuously data output when I place magnet on the sensor

 

Thanks

Vijay

0 Kudos
Message 1 of 26
(2,022 Views)

Hi vijay,

 


@vijay0507 wrote:

Using ethernet (LAN) I have established a connection between Gaussmeter and PC. Through RS-232 I need to send SCPI commands to communicate with the device. Using TCP I would like to communicate with the device. I have connect the labview to gaussmeter but its not showing any data values in the labview program. Even I have little doubt about the code, I dont know whether the code is correct or not. Could you please tell me the way I have implemented the code is right?!

and I need to get continuously data output when I place magnet on the sensor


  • Why do you need to send SCPI commands "through RS232" when you want to connect by LAN/Ethernet?
  • Do you get an error when the device "is not showing any data"?
  • To know if your code is "right" you need to read your device manual…
  • When you want to receive data "continuously" then your device needs to support that. Does it support a continuous data stream? What does the manual say about this topic?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 26
(1,992 Views)

Where are you connecting up to the instrument?  And what are the commands you are sending?

 

Personally, I prefer using VISA for communicating with instruments.  This allows me to switch between Ethernet, RS-232, GPIB, or USB and all that needs changing is the initialization.  The API is similar to TCP, but more is handled behind the scenes for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 26
(1,980 Views)

Hello,

 

I am new to LabVIEW and my questions would be obvious for some for you. So please help if you know the solution.

 

I am very new to LabView and SCPI commands. As part pf my work, I want to send SCPI commands in LV in order to communicate with Gaussmeter IGM11 to do the Magnet flux  Measurement via RS-232 cable.

 

The rest of the project was going well except for the LabVIEW part because as I said earlier, I am new to LabVIEW.

 

I am using the “Basic Serial Write and Read.vi” provided in the NI examples folder. The problem is that I don't know how to modify the vi in order to receive continuously the data coming from the Gaussmeter.

 

Thus, the first question is:
1.) How to read continuously from the RS-232 port? (I tried to use 'while loop' but with no success, maybe I was doing it the wrong way.) If you know the solution, please help me with your ideas and suggestions.

 

2.) The commands which I am using are follows:

 

  • :read? Which read the data from gaussmeter
  • <STX>+0298.<ETX> transfer data every 100ms
  • :idnt? Identification Query
  • :rst? Reset command.

Please help me whether I am doing the correct way. Please let me know your suggestions

 

Thanks & Regards

Vijay

0 Kudos
Message 4 of 26
(1,925 Views)

Hi vijay,

 


@vijay0507 wrote:

1.) How to read continuously from the RS-232 port? (I tried to use 'while loop' but with no success, maybe I was doing it the wrong way.) If you know the solution, please help me with your ideas and suggestions.


To repeat a certain part of code "continuously" you should use a loop.

When you already tried to use a While loop and had no success, then you made something wrong…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 26
(1,922 Views)

Hi GerdW,

 

Thank you so much for your reply. I couldn't figure out where the mistake is raising in the code. I was trying to read the data from the Gaussmeter IGM11 with RS-232 cable but not getting exact idea of the mistake. Can you please check the code once. Does my code can read continuously data with SCPI command "read". Please let me know your response.

 

Thanks 

Vijay

0 Kudos
Message 6 of 26
(1,918 Views)

In order to look at your code you need to post it. So far you only posted a screen show of a very small portion of your code That is not enough to work with.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 26
(1,913 Views)

Hi Vijay,

 

as you can see from my signature line I still use LV2020, so you need to attach a downconverted version of your VI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 26
(1,902 Views)

Hello Mark,

 

I have posted my code in the previous message. For your reference attaching the code could you please check it. let me know your valuable suggestion.

 

Thanks 

Vijay

0 Kudos
Message 9 of 26
(1,901 Views)

Please save it for an earlier version of LabVIEW. I do not have LV 2021 installed.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 10 of 26
(1,890 Views)