Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication RS-485 on Digital Metering

Solved!
Go to solution

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

PERFECT Modbus CVM NRG.jpg

 

 

 

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 :

Example Question.jpg

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 ?

 

Memory Map.jpg

 

But when I tried to read other parameter ( V, A, W, Var and PF on line 2 ) 

Memory Map 2.jpg

 

it didnt work, this is the result below :

Example 2.jpg

 

could you tell me what should i do to type in write buffer ? and please give me explanation

 

Thanks~

 

 

0 Kudos
Message 11 of 24
(4,020 Views)

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

 

 

Message 12 of 24
(4,013 Views)

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. 

 

 

 

 

Jesse Dennis
Engineer
INTP
0 Kudos
Message 13 of 24
(4,000 Views)

OH OK thats right ! ! i just realized that i request 20 register Smiley Very Happy

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~

0 Kudos
Message 14 of 24
(3,995 Views)

OK Jesse thanks, 

but i am still not found the page that explain how to calculate CRC, could you show me ?

 

Thanks~

0 Kudos
Message 15 of 24
(3,993 Views)

Use the ModBus library from NI. Link

0 Kudos
Message 16 of 24
(3,980 Views)

on MB CRC-16.vi ?

what should i fill on this vi ? 

i tried fill 0A04 0000 000A and this is the result below :

CRC.jpg

 

please give me example, will be better add the screenshot.

 

Thanks~

 

 

0 Kudos
Message 17 of 24
(3,975 Views)
Solution
Accepted by topic author rhiesnand

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.

 

 

crc.jpg

 

 

Is it not easier for you to use the Read Register VI's from the ModBus library ?

Message 18 of 24
(3,971 Views)

That's Great ! Thank you very much ! Smiley Wink i did it

 

Thanks~

0 Kudos
Message 19 of 24
(3,951 Views)

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 

0 Kudos
Message 20 of 24
(3,948 Views)