Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port

dear all,

         can anyone tell that what is the problem in this vi as read function is not responding in VISA. i am trying to send some command to power sensor through VISA 

thnaks

0 Kudos
Message 1 of 8
(5,249 Views)

Hi,

 

Post the VI. The picture does not show how you configured the port. Also tell which protocol you are using.

 

Kees

0 Kudos
Message 2 of 8
(5,243 Views)

i am posting vi

0 Kudos
Message 3 of 8
(5,239 Views)

What is the power sensor?  What is the command you are sending it?  Are you sure you shouldn't have the termination character on?

 

Some general notes:

1. No need for the second loop.  You can handle all of your GUI actions in a single loop with 1 event structure.

2. You should avoid using local variables so much.  You can use the terminals

 

Ok, just found where you are generating the commands to send.  You are not terminating your commands properly.  You are sending the ASCII characters '\' and 'r' when you should be sending a carriage return.  Change your constants to be in "\ Codes" view.  Then you can use the "\r" to mean a carriage return.

 

And since the commands use the carriage return for a termination character, I would be willing to bet that the responses will be doing the same.  So enable the termination character and set it to be the carriage return (decimal value of 13).  You can then get rid of the wait and the Bytes At Port.  Just tell the VISA Read to read a number of bytes that is a lot larger than the size of a response message you would ever expect.


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
Message 4 of 8
(5,234 Views)

thanks for your kind suggestion it solved my problem. now i want to know one more thing that how can i incorporated timer for 22 second. beacause there is option for zero setting  which send the ZS command to device and device goes into zero mode for 22 seconds and then only ZQ command can be sent which showa the status of the  device either completed or not.

 once agan thanks for your valuable sugestion.

0 Kudos
Message 5 of 8
(5,180 Views)

i am posting vi. can you tell why sub vi in zero mode of ok event in event structure is not showing timer on main vi 

Download All
0 Kudos
Message 6 of 8
(5,177 Views)

Sounds like you will want to make a state machine.  I would just use the Elapsed Time express VI to know when the 22 seconds are up.


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
Message 7 of 8
(5,151 Views)

dear thnaks for your valuable sugestion . i am using elapsed time vi but it is not running . i need to count 22 seconds and show it on front panel. meanwhile during counting i need to send command and recieve to device. will i able to do that and how. please neeed your help. once again thanks for suggestion

0 Kudos
Message 8 of 8
(5,121 Views)