LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending serial commands and reading the results of the test through VISA

Hello. First of all, forgive my ignorance. I have to include one feature to my project. I am supposed to send spesific commands to my code through serial port and depending on the command, I have to execute a test. The result of this test have to be read from serial port again. For this purpose, initial idea was to implement Real Term or Tera Term but I came to the conclusion that VISA would be much simpler to implement. However, I am still having problem to grasp the some stuff 🙂

 

I want to read the output as 'Pass' or 'Fail'. Is it possible to read the result of my tests directly? 

Would it be possible to integrate this Visa with TeraTerm or Real Term?

Thank you!

0 Kudos
Message 1 of 10
(4,241 Views)

You can read from VISA 4 bytes.
This will be the answer

0 Kudos
Message 2 of 10
(4,232 Views)

Sounds like you need to look under Instrument IO -> Serial pallet

There you will find the controls for Serial port, including configuring (open), writing and reading.

I am assuming if you know how to use Tera Term, you will know how to open and configure a serial port. Feel free to browse the Labview help and examples on the topic.

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 3 of 10
(4,225 Views)

Thank you! But in this case, how can I change the message as 'Pass' or 'Fail'? I mean what I do not get is that how can I control the output message to be shown in Visa Read? 

0 Kudos
Message 4 of 10
(4,220 Views)

Thank you @Frozen! Yes I know this actually but still I do not  know if Visa is directly linked to Tera Term. Can Tera Term get directly the message in Visa Read or send directly to Visa Write? 

0 Kudos
Message 5 of 10
(4,217 Views)

In any case you send to VISA the string and get from VISA the string.
And you can build any string

0 Kudos
Message 6 of 10
(4,214 Views)

I assume the output of this test is NOT "pass" or "fail" but you want to convert the output to that?  You need to understand what the test is returning.  Whoever created this test should tell you what to expect.  That's probably the toughest part of this exercise.  (Once you get the hang of VISA in LabVIEW - which we can definitely help you on!)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 10
(4,202 Views)

Thank you so much Billko!

Actually, I know what it returns. It basically communicates with the power supply and if it is able to establish a communication with power supply in the predefined time interval, it returns true. I was thinking either I could evaluate the test before Visa and send final result as the message 'Pass' or 'Fail' to  VISA OR the message which contains 'time' only. 

0 Kudos
Message 8 of 10
(4,194 Views)

@Rightphalange wrote:

Thank you so much Billko!

Actually, I know what it returns. It basically communicates with the power supply and if it is able to establish a communication with power supply in the predefined time interval, it returns true. I was thinking either I could evaluate the test before Visa and send final result as the message 'Pass' or 'Fail' to  VISA OR the message which contains 'time' only. 


I think you are confusing what you expect to receive in your VISA Read and what you want to display on the screen to the user.

 

Why do you need to send the instrument the "Pass" or "Fail" result?  

 

If you receive the proper response in the proper amount of time then it passes. 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 10
(4,189 Views)

I think you are right. The result of the test should be just displayed on the screen, not to be sent. I will need to send the data of the test though. In this case, I can put an additional indicator to display the result of test. 

Thank you all so much for your help! 

0 Kudos
Message 10 of 10
(4,162 Views)