[Gambas-user] Modbus on serial port

ariafrancesco@inwind.it ariafrancesco at ...86...
Wed Sep 14 08:57:53 CEST 2005


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





More information about the User mailing list