05-09-2014 02:30 AM
this is the video when i disable termination character
https://www.dropbox.com/s/xvgk0eut4qvluai/Stuck%20Byte%20Count.avi
i change method to compare the first string must be read. this is my screenshot and can work perfect
but i want ask how to made a question on modbus, i've tried this modbus according in my manual device, this is the example on my manual device :
on that example, from address that I underline 0A 04 00 00 00 0A 71 76 it means first register and the number of registers to be read, isn’t right ?
But when I tried to read other parameter ( V, A, W, Var and PF on line 2 )
it didnt work, this is the result below :
could you tell me what should i do to type in write buffer ? and please give me explanation
Thanks~
05-09-2014 05:27 AM
Hi,
I cannot play your video. Site is blocked by the firewall.
Yes, 0A 04 00 00 00 0A 71 76 means first register and the number of registers to be read, like I expleined before.
You try to read the next 10 registers with a wrong command.
Your data: 0A 04 00 0A 00 14 71 76
with this command you asking for 20 (0x14) registers from address 10 (0x0A) but in the picture you outlined 10 registers.
The CRC bytes are there for a check. You cannot use the same CRC for different data.
Please study the ModBus protocol in more detail.
If you want to ask for the next 10 registers you should use: 0A 04 00 0A 00 0A 51 74 but you should use a CRC calculator.
One more to help you. You can ask all (30) registers at once with: 0A 04 00 00 00 1E 71 79
Kees
05-09-2014 10:38 AM
Hi all,
There are at least three separate solutions for modbus already. Getting one or two commands to work isn't that difficult but if you have a lot of different command to send digital meter will be faster to use a prebuilt solution. You also can look at them to get an idea how to calculate the CRC.
05-11-2014 08:44 PM
OH OK thats right ! ! i just realized that i request 20 register
it should be 0A 04 00 0A 00 0A 51 74 , not 0A 04 00 0A 00 14 71 76
that is a question i wanna ask to you, how to calculate the CRC ? could you explain to me how to calculate the CRC ?
0A 04 00 0A 00 0A 51 74 ( from where you got 51 74 ? )
0A 04 00 00 00 1E 71 79 ( from where you got 71 79 ? )
i searching how to calculate CRC, tried this CRC calculator
http://webnet77.com/cgi-bin/helpers/crc.pl
http://depa.usst.edu.cn/chenjq/www2/wl/software/crc/CRC_Javascript/CRCcalculation.htm
and still didnt get it what should i do to fill on that text box, please explain me
Thanks~
05-11-2014 08:52 PM
OK Jesse thanks,
but i am still not found the page that explain how to calculate CRC, could you show me ?
Thanks~
05-12-2014 01:35 AM - edited 05-12-2014 01:38 AM
Use the ModBus library from NI. Link
05-12-2014 03:47 AM
on MB CRC-16.vi ?
what should i fill on this vi ?
i tried fill 0A04 0000 000A and this is the result below :
please give me example, will be better add the screenshot.
Thanks~
05-12-2014 05:36 AM - edited 05-12-2014 05:40 AM
The input is a string control. But is contains bytes which are not displayed as normal characters. What you did is entering hexadecimal data as a string (with spaces) in to a string control where is should be plain data.
If you change display setting of the control and indicators to 'HEX display' (Right Mouse Button) you will see what you want to know. You can also make the 'Display Style' visible.
Also a bug in this VI. Change the bottom indicator from U8 into U16.
Is it not easier for you to use the Read Register VI's from the ModBus library ?
05-13-2014 04:29 AM
That's Great ! Thank you very much ! i did it
Thanks~
05-13-2014 04:38 AM
hey K C what do you mean "Is it not easier for you to use the Read Register VI's from the ModBus library ?"
is there any other way to calculate CRC ? Read Register VI's ? i did not find where is Read Register VI