LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Testing Communication with USB RS422 for a stepper motor in LabView 2013

I am new to LabView and I am trying to fix a script that hasn't worked in over a year at my university. I have a stepper motor that I would like to control via LabView. The LabView version I have is LabView 2013. The stepper motor is an mdrive 23 motor driver plus made by Schneider. I was able to successfully establish a communication with the IMS Terminal that came equipped with the motor via a MD-CC4 USB to RS422 Comm Converter. However, I am having trouble establishing communication with LabView via the same USB.

I am using the following two links as references: link 1 and link2

 

I went to MAX and was able to see the communication link ASRL[board][::INSTR] (which is shown in the screenshots attached below which in this case it is COM6) however I don't see any option where for the Open VISA Test Panel. Thus, I am unable to test the communication and not sure how to proceed? I am using LabView 2013, any suggestions or help will be extremely appreciated. The script worked over a year ago but I was tasked to fix it and not sure what my next steps are.

I have attached my VI and screenshots of the MAX terminal that I have. Also, I am unable to find the NI-VISA app, is that app necessary?

0 Kudos
Message 1 of 20
(1,825 Views)

And you are going to get the magic 8-Ball response.  

 

Here's the thing about serial ports.... they are serial!  By definition of SERIAL they can only be used by one application at a time.   You guessed it... you cannot open a communication channel to a serial resource from somewhere and then try to use it from somewhere else! 

 

You have to close (release the hardware resources reserved by) the other application before you can use any other application (like LabVIEW) to get into that serial resource. 

 

Think ... two tin cans and some dental floss.   You have 1 friend on the other side.   To manage effective communication there must be only one communication expert on your side.  Your "Friend" can't be hanging on the line!


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 20
(1,801 Views)

Hi,

Yes, I did close the IMS Terminal before tying to establish communication to the motor using LabView so the designated port is open with no other application calling it.

0 Kudos
Message 3 of 20
(1,772 Views)

@robin_ali wrote:

Hi,

Yes, I did close the IMS Terminal before tying to establish communication to the motor using LabView so the designated port is open with no other application calling it.


Not "port available "

 

Hardware resources unreserved 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 20
(1,769 Views)

Hmm, sorry I am not understanding?

0 Kudos
Message 5 of 20
(1,762 Views)

Has the baud rate or "party mode" been changed?

 

https://motion.schneider-electric.com/downloads/manuals/MDI17_23_Plus.pdf 

 

Page 85 talks about how to address drives that have "party mode" enabled which requires that each device needs addressed in the command. Also on the first frame of your vi visa configure port defaults to 9600 baud, but that looks like it can be set. Make sure it matches with whatever is used in the other program.

 

Some other notes, the program is a bit of a mess, tons of local variables, sequence structures, and parallel operations that really should not be parallel. Seems like it could be greatly simplified with the use of one event structure that can handle the various button presses.

Message 6 of 20
(1,749 Views)

It is unlikely that the party mode has been changed but I can verify soon. 


@StevenD wrote:

 

Some other notes, the program is a bit of a mess, tons of local variables, sequence structures, and parallel operations that really should not be parallel. Seems like it could be greatly simplified with the use of one event structure that can handle the various button presses.


Thanks for the suggestion. Do you have a reference link I can look at in regards to those recommendation?

Also, my urgent initial task is to just try and see if LabView is able to communicate with the driver however I was unable to do that as the images I showed has missing features from the reference links I provided. Is the first step to first see if there is communication, correct? If so, how can I do that?

0 Kudos
Message 7 of 20
(1,711 Views)

Page on event structures

 

https://www.ni.com/en-us/support/documentation/supplemental/06/event-driven-programming-in-labview.h... 

 

The state of that code... I would keep it as reference, but trying to fix it is probably more effort than starting new. I would just take one of those case structures and get it into a new vi with a while loop and event structure. 

 

Start with this, once you learn how the event structure works build out from there.

 

Event Structure.png

Message 8 of 20
(1,705 Views)

Thank you! In regards to testing the communication of the stepper motor to the LabView via RS422 USB, how do I go about doing that? 

0 Kudos
Message 9 of 20
(1,691 Views)

Start simple. Copy the visa configure code and something simple like the "stop" command "WSL 0<LF>". Do a visa write with "WSL 0<LF>" and a visa read after and see if you get any data back.

 

Communication Check.png

0 Kudos
Message 10 of 20
(1,676 Views)