Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Turn laser on/off

Hello Folks,

Greetings!!

 

I am working on simple logic to turn laser on and off through serial port and string commands. I need to call CRLF as a terminator to do so (OK\r\n). I tried with different logics but somehow I am ending up with error at VISA read function. I tried to debug it but response was the same. 

 

I would really appreciate if someone helps/supports me on this. I have attached the two screenshot for reference that I tried with.

 

Your help will highly appreciated.

 

Looking forward to hearing from someone.

Screenshot 2023-09-29 150505.png

Screenshot 2023-09-29 145240.png

0 Kudos
Message 1 of 9
(1,210 Views)

It seems you set the termination character wrong.

Please use the settings in visa settings and don't set the termination character to an idiot value afterwards. It should be 10 in decimal for Linefeed.

 

The screenshot with debug on, shows this error.

Even better that you send the via next to the screenshot, because we can easily edit and send an improved version back.

 

greetings from the Netherlands
0 Kudos
Message 2 of 9
(1,184 Views)

Hello Albert,

Greetings of the day!

 

Many thanks for your prompt response. Could you please send me the revised sketch so that I can get to know were exactly I need to make the necessary changes in  the VI. It will be a great help and I would appreciate it!!

 

Looking forward to hear from you.

 

Thanks

0 Kudos
Message 3 of 9
(1,151 Views)

Please attach your VI, then I dont have to rebuild your VI from a picture but edit it.

greetings from the Netherlands
0 Kudos
Message 4 of 9
(1,139 Views)

Hello Albert,

 

Please find the attached vi file. Please let me know if you need anything else. Many thanks for your support and help.

 

Thanks,

0 Kudos
Message 5 of 9
(1,119 Views)

Hi

my post was blocked, I send the vi first, and later the explanation.

greetings from the Netherlands
0 Kudos
Message 6 of 9
(1,092 Views)

Good evening.

Below my changes to the vi.

 

I changed the display mode of the constant string into  backslash mode.

 

I also changed the termination symbol into a Line Feed.


I also ask too many characters.

This is not a problem because your instrument sends a Line Feed as end character  VISA will read it correctly.

 

greetings from the Netherlands
0 Kudos
Message 7 of 9
(1,090 Views)

Hello Albert,

Good Evening,

 

Many thanks for your prompt reply and attachment. I am grateful for your support and help being provided. I checked it on hardware by connecting my Laser diode to my PC, its works fine!! Without any error.

 

Thanks you so much for the help!! 

 

I will be in touch with you if I need any help on this further. 

 

If you don't mind, could you please share me your email id.

 

Many thanks for your reply and help.

 

Regards,

Madhu

0 Kudos
Message 8 of 9
(1,079 Views)

Hello Albert,

Good morning!!

 

Yes, it did solve my problem and working fine with the hardware (Laser diode).

 

Thank you so much for your help.

 

Regards,

Madhusudan 

0 Kudos
Message 9 of 9
(1,044 Views)