[Scilab-users] ?==?utf-8?q? help for RS232 programming

Antoine Monmayrant antoine.monmayrant at laas.fr
Tue Aug 16 14:22:38 CEST 2016


Hi,

Here are few pointsI usually check when facing communication issues with RS232/GPIB:

- Are you sure you have set the serial port correctly (delimiter, baud rate, parity, ...) ?
- Are you sure your controller is supposed to answer something to this command ?
- Is the syntax for passing the arguments correct (separator in particular that can be nothing, blank or even comma) ?
- Do you have a command without arguments that returns a known value (like *IDN? or *SN? that should return a string with the id of the controller) ?
- Did you try to connect to your controller using hyperterminal or putty to see whether the problem comes from Scilab?

Hope it helps,

Antoine

 
Le Mardi, Août 16, 2016 13:10 CEST, Philipp Mühlmann <p.muehlmann at gmail.com> a écrit: 
 
> Dear all,
> 
> 
> using the "Serial Communication Toolbox" I try to Access a Controller via a
> RS232 Interface.
> 
> 
> 
> Now, since I am a very beginner in this field I could use some help.
> 
> 
> What I do:
> 
> 
> h = openserial(1," 9600,n,8,1");
> 
> 
> If I look at "h", this is what I get:
> 
> h = file15873640
> 
> I understand this is a string of a so called Serial port file...so I assume
> that a connection is established.
> 
> 
> --> What does this mean?
> --> How to Display the Content of this file?
> 
> 
> Now, once I have connetion established I want to communicate with the
> controllr.
> 
> Example: I want to send a command with following command structure:
> 
> 
> 
>        <address>_<command>_<Parameter>_<value>§
> 
> *A_r_120_0
> 
> *      = for Synchronisation
> A     = address
> r      = command for reading
> 120  = Parameter for actual sensor value
> 
> I try:
> 
> ret = writeserial(h, " *A_r_120_0 " );
> 
> result = readsearial(h);
> 
> 
> I get:
> 
> ret = 0   // seems to be OK
> 
> result = ?????
> 
> 
> --> What does this mean?
> 
> 
> I use:
> 
> Scilab 5.5.1 on Win 7  64bit.
> 
> 
> 
> Thank you,
> Philipp
> 
> 
> 
> 
> -- 
> In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.
> 
> There we have the salad.




More information about the users mailing list