LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I output the responses of my modem in a VI after every command I send it so I may view and document its actions?

Solved!
Go to solution

Hello fellow LabVIEW'ers!

 

I am creating a program that will query a modem which is connected to the serial port of my pc.  I am using VISA functions starting with the configure serial port and then i have connected it to the WRITE function, then the BYTES AT PORT, next the READ function, and lastly the CLOSE function.  The problem statement is as follows:

 

~How do I output the responses of my modem in the VI after every command I send it so I may view its actions and ultimately make a query report out of it?

 

Furthermore, I am not sure if the syntax of my commands are correct.  Alternatively, I have used an interface program called cygwin and one command I used is "ssh root@"ipaddress" [enter]  this leads me to the login command of my modem.  Would this cygwin command syntax work with my labVIEW VI? If not, then how do I know what command syntax to use in order query my modem from LabVIEW?

 

Supplemental Information

Modem - "Evolution" Satellite modem

LabVIEW Version - 8.6.1 Professional

Communication Method - Serial Port

 

I appreciate any assistance from those I receive it from, and I also hope that the responses to this question benefit many who come across it.

0 Kudos
Message 1 of 8
(3,223 Views)
Solution
Accepted by topic author Magnus42

It seems that you have apples and oranges there. cygwin is a Linux-like environment for Windows. It gives you a bit of Linux look-and-feel in Windows. ssh is a secure shell, which is a network protocol, not RS-232. The serial port is a different interface. It may or may not have the same commands as what you use over ssh - the manual will tell you that.

 

As for the serial interface that you want to do, it sounds like you just want to do something like what the old LVTerm does. You can give that VI a try to see if it does what you want.

Message 2 of 8
(3,211 Views)

Thank you very much my fellow labviewer, this program has allowed me to move forward in my project.  I really appreciate your help.  If you don't mind me asking, how was this program constructed? It seems that it has been derived from LabVIEW, but there is no control panel or block diagram and I can not minimize it to my toolbar; it's not that I need to, but I am not aware of this VI construction method.

 

Magnus

 

p.s. thank you once again

0 Kudos
Message 3 of 8
(3,201 Views)

The VI was set up to run when opened (not sure why). If you click on the Quit button the VI will stop and you can then look at the block diagram. You can change the window appearance at that time to show the minimize button (not sure why the author chose to hide this):

  1. Select File -> VI Properties.
  2. Select the Window Appearance category.
  3. Click Customize...
  4. Check the"Allow user to minimize window" option.
  5. Close the properties and resave the VI.
Message 4 of 8
(3,194 Views)

Hello again smercurio!

 

I was hoping that you could provide me with some more guidance concerning the task which I am trying to accomplish.  The LVterm VI which you directed me to worked well however, I am still having one major problem.

 

~How do I save the responses of my modem in a file?

 

I have tried using various save functions in the Save I/O palette, VISA palette, and I have also tried to use an echo command in the LVterm VI, but unfortunately nothing seems to work.  I am beginning to think that my approach at outputting and documenting the responses of my modem using the VISA functions & LVterm may be incorrect.  Even after numerous hours of labview research on the internet, I feel like I have arrived at a dead end, so if you have any suggestions for me, I would greatly appreciate it.  Thanks smercurio.

 

Magnus

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

There's a variety of ways to do that. One simple way is to simply add a Boolean control on the front panel to turn on the logging and a file path control. The code for it is a simple case structure:

 

 

Note that this will save the entire contents of the text indicator as it gets updated, so it's not a "OK, let's log this bit, now let's turn off logging for this bit, etc.". If you want the latter, then wire to the string that is being appended to the text indicator, but you have to open the file at the start of the program, and append to it as it runs (see second attachment).

Note that this is just a starting point. You would need to handle error checking as well as handling someone not entering a filename, etc. 
Message Edited by smercurio_fc on 08-07-2009 09:03 AM
Download All
0 Kudos
Message 6 of 8
(3,163 Views)

AHH!!!!  Thank you once again smercurio.  your assistance has once again been a great help.  Earlier today when i said i had reached a dead end, i decided to run through a list of random functions which I did not understand and I came across a "Property Node."  Im sure you know about its functions, but for the sake of our fellow labviewers who might read our thread, I would like to explain the way (aside from yours) of how I outputted the "conversation" I had with my modem on the front panel (which I will eventually save in a zip).

 

I selected a property node in the VISA functions palette (but it is also located under another palette which I cant think of at the moment) and I  right clicked the top half and selected "Link to" -> "Pane".  Then i selected my command string since thats what i wanted it to be linked to.

 

Next I left clicked the bottom half and selected "select property"  and chose "array value" since my command string is in an array.

 

After this, when i ran my VI, my command response on the front panel (also in an array) outputted the commands i sent and responses from my modem:)

oh yea, i forgot to add that i attached an "empty string constant" to the input of my property node.  I also forgot to mention that i right clicked the node and selected "change to write all."

 

Well, thank you smercurio once again for sharing your knowledge with the LabVIEW community!

 

Magnus

0 Kudos
Message 7 of 8
(3,142 Views)

You don't really need to go through all that to get a property for a control/indicator. You can simply right-click on the control/indicator and select the appropriate property (or method) from the popup menu.

 

It seems you are using a different program since LVTerm has no arrays on the front panel. That said, I don't quite understand what you're doing with the property. I think you may not be realizing that the terminal of the control/indicator actually provides the value, so it is not always necessary to use a property to get the value or set it. Just branch a wire if you need a control's value in more than one place. If you're talking about an indicator, then simply wire to the indicator to set its value. The Value property still has its uses, such as needing to update a control programmatically, but it should not be used where a wire can be used instead, as the wire is way more efficient.

0 Kudos
Message 8 of 8
(3,128 Views)