Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

hyperterminal

I am using a Microlynx (Intelligent Motor systems) to run a motor through an RS232 com port. It comes with an IMS Terminal software and can also be worked on with Hyperterminal. I have a program with all the functions I want it to perform and once I load this into the memory of the Microlynx using one of the above softwares, I am able to communicate with the device very easily with labview using a carriage return as term character. However, I want to be able to load the program into its memory each time I power it up and this is where I am running into problems with LV (8). If I use VISA write file, the motor treats each line of the program as a command and tries to execute it but since its memory is blank, it can't recognize it. if I try to write the whole program in using a string constant, it does not like that either. Is there some way to replicate the "download program" function of IMS Term OR "send text file" of Hyperterminal in Labview?
its not a term character issue - once the program is loaded, it works fine on labview.
Thanks!
Sue
0 Kudos
Message 1 of 6
(4,510 Views)
Hello Sue,
 
There is a VISA VI called VISA Write FromFile.vi that will take data from a file and write it synchronously to the device.  This VI can be found in the functions pallette Instrument I/O>>VISA>>VISA Advanced.  There is also an example found in a similar discussion forum Serial Prot Download
 
Daryl E
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(4,484 Views)

Daryl,

"Visa write from file" is what I meant - I guess I missed out the "from" while typing. Even when I use that function, it tries to execute each line of the file. Any other suggestions?I'll look at the Serial Port Download board in the mean time.

0 Kudos
Message 3 of 6
(4,475 Views)
Sue,

Can you make the program code part of your overall MicroLynx program or save it to a separate section of memory in the MicroLynx?
I have never tried this, but maybe loading something like this would work:

pgm 1     "start main program at line 1
"main code
end         "end main program
pgm        "exit program mode (I do not know if this is necessary)


pgm 100 "start program at line 100 (that you are trying to load with LabVIEW)
"code
end
pgm


Of course, you will have to save this as the default program if you want it to be in memory every time the MicroLynx starts up.
To start the second program you would send "exec 100\r" through the serial port.

If this does not work,or is not what you want, you may have to contact IMS or do some other research to see what Hyperterminal or IMS Terminal is doing when it loads the program to the MicroLynx.

Regards,
Jon



0 Kudos
Message 4 of 6
(4,440 Views)

Jon

This your solution did help us a bit. Someone else working on the project figured out that I needed to add 2 carriage returns between every 2 lines of the program for it to go through. Otherwise it was jumbling the program up with line numbers. It took a while but its sort of taking shape now. I am not sure if it has something to do with the timing. Maybe there is a better way of doing it but for now, this seems to work.

Thank you!

Sue

0 Kudos
Message 5 of 6
(4,390 Views)

I'm glad you're getting somewhere. That's interesting about the 2 carriage returns between every 2 lines of code...sometimes the solution can only be found by random experimentation.

Jon

0 Kudos
Message 6 of 6
(4,384 Views)