From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Steps for Running and Calibrating the Stepper Motor in LabView

 

 

0 Kudos
Message 11 of 26
(538 Views)

Hi any suggestion for this?

0 Kudos
Message 12 of 26
(518 Views)

Hi Raven,

 

I tried to connect the com port 1 for my stepper motor and awaiting for the response on the LabView, still it doesn't show any response. I have perform all the troubleshooting (Visa Error - 1073807339). Now for all my command I am getting the similar error. If you can assist me, last week, I was using the similar command and program was working well

 

One more question: I open my LabVIEW program and then open the MAX, go to the ASLR Com1 (open visa test panel, It doesn't open until I close the current LabVIEW program). Later on, I have click the termination character \r. I click apply and then I restart my same program but when I go to Max again, the same box (termination character) is unchecked. Do you think I have save the option properly for that program. ?

 

 

Command: MN (model number)

Expected response : b

Yeah there is carriage return. 

 

24.png

 

 

0 Kudos
Message 13 of 26
(510 Views)

@skdubey wrote:

One more question: I open my LabVIEW program and then open the MAX, go to the ASLR Com1 (open visa test panel, It doesn't open until I close the current LabVIEW program).


Only one application can have the open serial port at a time - if one application is using the port (e.g. LabVIEW) then others (e.g. MAX, or the SCL Configurator) cannot use it.

 


@skdubey wrote:

...

I tried to connect the com port 1 for my stepper motor and awaiting for the response on the LabView, still it doesn't show any response. I have perform all the troubleshooting (Visa Error - 1073807339). Now for all my command I am getting the similar error. 

...

Later on, I have click the termination character \r. I click apply and then I restart my same program but when I go to Max again, the same box (termination character) is unchecked. Do you think I have save the option properly for that program. ?

 

 

Command: MN (model number)

Expected response : b

Yeah there is carriage return. 

 


This error is a timeout - it might be you're reading a large number of bytes, but have the wrong termination character set?

The default when you use Configure VISA Serial Port is 0x10 (Line Feed), not carriage return (13, \r).

I can see you have a 13 wired on your image, but I can't see for sure it's connected to the correct input (although I guess it probably is?)

 


GCentral
0 Kudos
Message 14 of 26
(501 Views)

You might also consider that you're sending that message as quickly as you possibly can, in a loop with no wait.

Is it expected that the device can always respond in that manner?

 

Perhaps add some Wait node(s), to slow down the loop iterations.


GCentral
0 Kudos
Message 15 of 26
(494 Views)

Hi cbutcher,

 

thanks for your response.

 

I have tried configuring the serial port according to the manual. 

 

Still, I am not seeing any response from the motor, I  also tried to connect the other device M to the same com port 1 with the different command protocol(*0100P3CrLf) and its working. Also Last time, I use the same device and  it cause the loss of of response from the motor. Do you think, other devices with the different set of command instruction could interfere reading measurement of other device to the same port.  In that, case how we can bring the system to earlier mode like any restart or something (setting in MAX). 

 

a. Stepper Motor Command protocol: 

25.png

 

b. Yeah number 13 is chosen as the code for the carriage return for the serial port configuration

26.png

c. I can run the motor from the SCL configurator (software from the manufacturer) command and it is also connected to the same com port but after closing the LabVIEW. It means there is no issue with the com port.

 

I am aware this is bit difficult but, I hope if you assist it will great help.

 

thanks

 

0 Kudos
Message 16 of 26
(493 Views)

I have tried to add 200ms, I am not sure how we can add that waiting time, is there anything in manual, I should look for. 

manual in case if you wanna look : https://appliedmotion.s3.amazonaws.com/Host-Command-Reference_920-0002V.pdf

 

27.png

0 Kudos
Message 17 of 26
(488 Views)

Although I absolutely definitely do not recommend this as a long term solution, what happens if you run this code (for a few seconds)?

Example_VI.png

 

I would hope that the "String so far" indicator will add some text, and then you'll get a timeout error after a couple of iterations, and it will finish. Error out will display timeout, but hopefully the "String so far" will display your "b" and a <cr> (although I forgot to set the display mode here, so you won't really see that so well, you could change that...)


GCentral
0 Kudos
Message 18 of 26
(478 Views)

Regarding bad inputs or saved state from previous attempts, you might try VISA Clear and/or VISA Flush I/O Buffers.

These probably shouldn't need to be part of your final code, but might help you if you've locked something up somehow.

However, I wouldn't really bet on it...


GCentral
0 Kudos
Message 19 of 26
(474 Views)

Thanks cbutcher

 

This is the response I am getting from your code. 

Like: I tried to do all the steps for the time delay and other troubleshoot still my LabVIEW program cant read the message from the device or no response from the device. Funny part I am getting the response from the software (SCL utility which is using similar command and same com port ). Any suggestion will be really helpful.

 

28.png

0 Kudos
Message 20 of 26
(456 Views)