From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

about Labview VISA configure

I'm trying to build a driver for a laser.

Q1. I used the VISA Configure Serial Port to initialize, and write the command to the register. the command was for selecting a laser channel, but it doesn't show on the analyzer.

initialize and configure.png

initialize and configure_back.png

 

 

Q2. Can I use the same configure to write multiple strings in multiple times? for example, to write 011E0001 to select channel, and write 011F03E8 to set power.

configure.png

0 Kudos
Message 1 of 10
(3,184 Views)
The VISA Configure Serial Port is NOT used to write commands to the instrument. Just like you have in your example, that is what a VISA Write does. You are probably talking about the reference out of the configure function and yes, you use the same reference for multiple writes. Just wire one after the, joining the reference out to the reference in. Do the same for error out to error in. Optionally, have a write inside a for loop and pass in an array of commands.
Message 2 of 10
(3,171 Views)

Hi,

 

Try something like this  and  use VISA Close. After all communication is complete, the VISA session is closed.

 

 

ScreenHunter_33 Aug. 29 14.03.jpg

 

 

 

 



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
Message 3 of 10
(3,149 Views)
Since the majority of instrument communication is to write a command and then request data, your operations are backwards.
0 Kudos
Message 4 of 10
(3,139 Views)

Smiley Surprised

 

 

I just draw that... should be write first...Smiley Embarassed 



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 5 of 10
(3,132 Views)

sorry I don't quite understand what the for loop here means. for example, I want to write a string to select a channel, and then run. then, write another string in the same string controller, and then run...but the for loop seems run automatically, how can I write multiple strings?

0 Kudos
Message 6 of 10
(3,126 Views)
There is no for loop. There is a while loop In the previous post and no, that would not normally be used.

What don't you understand about my answer for multiple strings?
Message 7 of 10
(3,116 Views)

do you agree for this one? simple write and read?serial.png



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 8 of 10
(3,109 Views)
It's simple but doesn't answer the question about multiple writes. As I said, multiple writes are just wired in series or an array of commands is passed into a for loop with one write inside. Whether or not there is s read will depend on the command.
0 Kudos
Message 9 of 10
(3,092 Views)

I finially figure out multiple writes..   Smiley Frustrated

 

multiple write.png



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 10 of 10
(2,869 Views)