[Gambas-user] Modbus on serial port
Werner
werda at ...1000...
Wed Sep 14 09:45:58 CEST 2005
Werner wrote:
> ariafrancesco at ...86... wrote:
>
>> I am trying to implement the serial modbus protocol on gambas.
>> Bookcase was my intention to create a class that all could use but I
>> have a problem that I do not succeed to resolve.
>> The instrument with which I try to communicate seems that it
>> understands what I send but does not answer to me .
>> What you know version 1,0,3 of gambas has of the problems with the
>> object of the serial port?
>> In order to create the string to send to the instrument I use:
>>
>> strOutput = Chr$(CByte(Val ("&H "& strNode))) & Chr$(3) &
>> Chr$(CByte(Val ("&H" & Left$(varTemp, 2)))) & Chr$(CByte(Val ("&H "&
>> Right$(varTemp, 2)))) & Chr$(0) & Chr$(1)
>> in order then to send it with:
>>
>> PRINT # Sport, (strOutput & Chr$(CByte(Val("&H "& Right$(strCRC,
>> 2)))) & Chr$(CByte(Val("&H" & Left$(strCRC, 2)))))
>> Is possible that problem is the character set ?
>> Gambas use UTF8 character set so is possible that using the Chr$
>> function the instrument does not understand?
>> P.S. I sure that the instrument receives the string , in fact it
>> count the message and understand that it is for he (strNode = "1"
>> node 1 of net modbus 485)
>> HELP!!
>>
>> Is possible that I'm successful to write an OCX for the modbus in VB6
>> and does not succeed to make of the porting on Gambas!!!!!
>> P.S. 2 :-)) where I can find the rpm of last stable gambas for
>> Mandriva?
>> THANKS To ALL
>>
>>
>>
> The latest stable version is 1.0.11. The download for all
> distributions starts here: http://gambas.sourceforge.net/download.html
> To find out if there is a problem with character conversion you might
> want to hook up with a second computer using a terminal emulator
> program that can display SOH DEL ESC NUL and all the other control
> characters. Alternatively you could write a small gambas program for
> it simulating modbus simple replies.
>
> Just my 2 cents.
>
> Regards,
>
> Werner
>
> I just tried Rob Kudla's web site to look up Gambas for Mandriva but
> the site just serves an empty page. Tough luck.
Werner
More information about the User
mailing list