LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB to 422 Converter Woes

Brian,

Thanks for posting the VI. I am able to run single commands through LV to an M23, but when trying to run scripts it seems to only run the last line of the script. I saw someone else ask a similar question about running scripts so if anyone knows how to do it I would greatly appreciate any insight.

regards,

Bill

0 Kudos
Message 31 of 53
(3,121 Views)
Bill,

I was able to run a script from the internal memory after downloading to the MDrive17 through IMSTerminal. The first line of the script should specify the line number in memory. eg from MCode manual:

PG 100        "enter program mode at line 100
...
...
E                  "end program
PG               "exit program mode

You can run this through labview by sending the command:

EX 100         "execute at line 100

This is all a work in progress so I will let you know if I find out anything more.

Sam
0 Kudos
Message 32 of 53
(3,111 Views)
Hi Guys,
I eventually wrote an entire program using Labview to interface with the controller. One VI just sent the program to the controller -- one line at a time after being dynamically built. It then read the echos and compared them to what was sent. The memory is large enough to have many small programs loaded and you can call them from a front panel.

You guys seem to be on the right trail, but let me know if you have any more specific questions.

Jim
0 Kudos
Message 33 of 53
(3,091 Views)
This is what I am trying to do. Based on what Sam did, I had LV read in a file and store each line in the row of a string array. Then created a loop that would send each row of the array to the controller sequentially. This should work (although I haven't got it working just yet). I'm a novice at LV so if anyone has any better ideas I'm certainly all ears (apologies to ross perot).
Message 34 of 53
(3,075 Views)
I have attached my VI. It seems to be working. I am able to load read in a script from a file into a string array, then send each row of the array to the controller. I can then execute the script. I welcome suggestions, critiques, etc.
 
regards,
 
Bill
0 Kudos
Message 35 of 53
(3,066 Views)

Bill,

This is very helpful. I just started using LV and appreciate the examples. Have you run into any problems with reading from the port. What Echo Mode do you have your MDrive set to?

Sam

0 Kudos
Message 36 of 53
(3,050 Views)

Hello Sam,

Echo Mode is the default, which I believe is full duplex. Yes, it seems what it read back from the port isn't exactly what I put in (extra spaces etc). Nothing that appears to effect the program. I loaded a script with a loop, which was supposed to print out the index variable as it cycles thru the loop (works when using the IMS terminal program). With LV I don't see this.

0 Kudos
Message 37 of 53
(3,043 Views)

Labview Help

So I have been working with the examples that have been attached in this thread in order to try to program my two linear stages with two MDrive17Plus to scan a planar area. I am using that VI which reads the file into the Drive memory, but for some reason keep getting an error. Could someone please look at what I am doing wrong? I think I may have hooked up something wrong. I am very new to LV and the debugging is confusing at the moment. I could not figure it out.

Thanks,

Sam 

0 Kudos
Message 38 of 53
(3,014 Views)
Sam,

What error is it that you are seeing, and where is it coming from? You should be able to use the highlight execution mode to watch how your program flows and see where the error is occuring.

Let us know!
Rasheel
0 Kudos
Message 39 of 53
(2,983 Views)
I went home for the weekend, and now that I am back, I can not get the read text file VI to work. It does it is supposed to but gives errors ate each VISA write. See attached image.
0 Kudos
Message 40 of 53
(2,976 Views)