02-05-2021 06:58 PM
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?
02-05-2021 07:24 PM
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!
02-05-2021 11:45 PM
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.
02-06-2021 12:04 AM
@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
02-06-2021 01:15 AM
Hmm, sorry I am not understanding?
02-06-2021 01:57 AM
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.
02-06-2021 02:42 PM
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?
02-06-2021 03:07 PM
Page on event structures
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.
02-06-2021 04:42 PM
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?
02-06-2021 07:00 PM
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.