06-10-2016 07:37 AM
Dear all
Seems modbus is a way to comunicate with drives for a long time. For me and because we have a new machine equiped with invertel P2 drive is new.
So, after many emails between invertek I could not do so much than comunicate with the drive with their software. Only saise to go to modbus.org
For their software i use a rs485 to usb converter and I use pins 4 and 5 (pc connection) but for modbus I change it for 7 and 8 (modbus)
In attach is the manual for modbus for the driver.
My question is, what is the simplest vi to read (for now) some registers and the way to input. I need to input 03 (for read) and then the register number?
Please help for the first step then I will build the complete software (I have now the modbus library installed)
Thanks in advance
cpalka
Solved! Go to Solution.
06-10-2016 08:43 AM
Hi,
Actually you have to unknown issues in this. One is de HW layer, the RS-485 interface. The other one is the software layer the ModBus protocol.
For the last one you can use the attached VI. It will read from slave 1 with command 03 1 byte from register 15. Data is: 0103 000F 0001 B409
The other issue is the RS-485 interface. If the VI does not work: How long is your cable ? Do you use terminators ? Some manufacturers reverse the + and - (or A and B)
Kees
06-10-2016 09:59 AM
Hi Kees
first of all thanks for the answeaer.
i could not open the attach because I have LB2013.
Can you please convert it?
Seems that i need all time convert the register to hex number before send it.
I saw some modbus examples that only ask for the adress, and register number (I think modbus blocks in block diagram do the hex conversions and calculate ate the end the checksum.
Please see some examples that i found and next monday I will try with drive (today is an holliday) give me your opinion about if it will work only input the register number (should be a problem) because some register can bem read and write depends on command 03 or 06 right?.....So seems I need to use the string you suggest. My problem will be the checksum.
best
cpalka
06-13-2016 05:29 AM
Hi,
Here is my VI in LV 2013
The VI 'GS2 Control - Read' could work, but you have to change to Mode from ASCII to RTU twice.
The other VI's should also work.
If none them communicate with your device you should check the interface. Check my previous post, reverse + and - and other things
Figures in HEX or decimal is just a presentation 0xA is the same as 10. For me Hex is easier but I can understand that other prefer decimal notation.
Command 03 is read register and command 06 is write (single) register.
Kees
06-13-2016 06:30 AM
Hi Kees
After doing some changes in your code, now i get the answear.
Bu the string should be like in instructions
01 03 0007 0001 35CB and the answear for about 3Hz was 0103 0200 2238 5D00 0000 0000 0000 0000 0000 0000 0000 0000 00
so the 2238 should be the data that has the frequency value....
Can you do some changes in code attached?
Thanks
CPalka
06-13-2016 06:56 AM - edited 06-13-2016 06:57 AM
The answer 0103 0200 2238 5D produces 0x0022 as data. In the answer the third byte is the number of bytes in the data. The last two bytes is the CRC.
I change the wait. If you place it somewhere in the While-loop you don't know when it is executed. It should be a part of the dataflow.
Kees
06-13-2016 07:31 AM
Hi kes
Can you please convert it for LV2013?
Sorry for that
CPalka
06-13-2016 08:51 AM
Sorry......
06-13-2016 09:44 AM
Hi kees
Thanks for the new version
Could you help me find the value from the reply 0103 0200 2639 9E00 whaen request output frequency?
Now I am controoling the driver with a potentiometer and show me in the display the adjust frequency.
I adjust it for 10.0Hz and I could not find a way to convert the 2639 for a value near 10.0Hz.
Best regards
cpalka
06-13-2016 11:20 AM
Hi kees
One more thing
In register 7 (request frequency)
I request 0103 0007 0001 35CB
For 0.0Hz reply 0103 0200 1579 8B00
10.0Hz 0103 0200 2639 9E00
20.0Hz 0103 0200 2178 5C00
30.0Hz 0103 0200 20B9 9C00 the same
40.0Hz 0103 0200 20B9 9C00 the same and for 50.0Hz the same.
Why the driver don’t send different data after 20Hz?
Note the driver is controoler by a potentiometer. it will make me cruise.
In the code I need to convert data from U16?
Attach is your code with some changes to try convert the string to a decimal number, no sucess.
Bes
CPalka
Best
CPalha