[Visual-devel] Re: Modbus module (was: Re: [MAT-devel] Re: Re: Re: MATplc - VISUAL interface)
Status: Alpha
Brought to you by:
lettoz
From: Thomas H. <Tho...@we...> - 2002-11-18 10:41:26
|
Hello Mario, > Thomas Hergenhahn wrote: > > ...connection. Keeping the connection would be better with VISUAL.I tr= ied to set > > it to false, but the modbus module opens a new connection for each tra= nsfer. > >=20 >=20 >=20 > Strange! I'll have to check on why it is doing that! > Either we have a bug in our modbus module, or else it is not receiving > the response packet from the slave, and assumes that the connection has > an error. In that case, the modbus spec. says we should close the > connection and start up another! Oops, this may be my fault. I must check whether I give a correct answer. >=20 >=20 > (...) > >=20 > > 2. 32 bit and floating point: > > I tried to get values from the oven demo. I inserted into the maPLC.c= onf: > > map out digital=5FIO.out=5Fword.1 TFTemp > > In principle I get some number, but in a 2 bytes (word) message. Is th= ere a > > way in modbus protocol. > > a) to transmit a 32 bit value=3F >=20 > It should be transmitting all 32 bits of the float. Yet another issue I= > will have to check out. There is a notice in the source about currently supporting only 1 word tra= nsfers with function=20 code 16. I wrote some extensions and can transfer float now (without type informati= on) >=20 > > b) to transmit the type float=3F >=20 > I don't think so. Modbus has no concept of variable types. What we > should/are doing is casting the 32 bit float onto a unsigned 32 bit > integer, and sending that integer instead! Ok, this is what I do at the moment, sending the 4 bytes which make up a f= loat as two words.=20 Only that the manual confuses me about endianess and which byte should go = where. Wish I had a real world modbus conform device to test what IT does. >=20 > Yep, this is intentional. It seems that this is the modbus way of doing= > things. It got me confused too at the beginning. Somebody convinced me > that this is how it should be. If you can convince me otherwise, it is > trivial to change it once again! Ok, I RTFSpecification and found it is said to be this way. Cheers, Thomas =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Viren=3F Wir wissen nicht was Ihr Arzt empfiehlt. Wir empfehlen den Virencheck f=FCr Dateianh=E4nge! http://freemail.web.de/features/=3Fmc=3D021159 |