05-22-2017 03:53 AM
Hello everyone
First of all I have to say that I know almost nothing about LabView, so I would like to apologise for my ignorance.
I have to read data from an electric motor drive; these data are sent to a computer via serial port (protocol rs-422).
This is all I was able to do:
With this VI I'm reading nothing.
What I think is the problem is that I have to ask the drive to send data, but I don't know how to do that.
With the drive came a software that should have done all this; too bad it's garbage and almost useless.
PS: even NI I/O Trace is not seeing anything.
05-22-2017 04:24 AM
What model is the motor drive? Do you have the manual?
Some general issues with your code:
1. The Configure Serial Port should be before the loop and the VISA Close should be after the loop. You are constantly opening and closing the port. So if any data happens to come in while you have the port closed, you will miss that data.
2. For 99% of systems out there, the Bytes At Port is the wrong choice for deciding how many bytes to read. You can get parts of messages quite easily due to its nature. But without knowing the protocol (the format of the data), I cannot give any real advice of an alternative.
3. You should stop your loop on an error. And make sure you have displaying that error. Those often will tell you when there is an issue with your set up.
05-22-2017 04:30 AM
05-22-2017 05:15 AM
Thank you all for your responses.
I don't know the name of the USB adapter but it works fine; I'm currently able to do everything with the motor, and with its own software I can see the data I need (speed and position from the encoder integrated in the motor).
The problem is that the trace function in this software samples data with a predefined time step (which is unknown) and can't be changed; I have to choose the time step because I need to couple the position information with a force information coming from another instrument.
The drive is EcoTech4 from Selema; I have the manual but it's written in italian and above that there aren't information about the communication protocol.
I only know this:
RS-422
baud rate: 19200
data bits: 8
parity: even
stop bits: 2
I can't attach the exe of the sw I was talking about.
05-22-2017 05:38 AM
Based on what I could find in the manual, it looks like this device uses a Modbus protocol. Modbus is a register based protocol, so you need to know which registers hold the data you need. Call up the manufacturer and ask for details. There are a few libraries out there for doing ModBus with LabVIEW.
05-22-2017 07:35 AM
Here is a manual in English primarily for Service Installation, but it does get into some of the programming and operation later in the manual.
http://www.selema-srl.it/demoselema/wp-content/uploads/2016/01/ECO-TECH-EVO-Man-Install_EN.pdf