Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : cserial toolbox details
Login with GitLab

cserial toolbox

Serial port C MEX functions
(430 downloads for this version - 430 downloads for all versions)
Details
Version
1.0.0
Author
Allan CORNET (Nelson software)
Owner Organization
Nelson software
Maintainer
software nelson
License
Creation Date
June 29, 2020
Source created on
Scilab 6.1.x
Binaries available on
The maintainer of this module has not provided binaries.
Description
            C MEX interface for serial port.
 Compatible with all software supporting C MEX API.
 List of builtin availables
    - getPortNames() returns a cell with available ports.
    - id = openPort(port, baudrate [, databits [, stopbits, [parity,
[flowcontrol, [rtscontrol]]]]])
 supported baud rate: 0, 50, 100, 110, 134, 150, 200, 300, 600, 1200, 1800,
2400, 4800, 9600, 19200, 38400, 115200, or 921600.
 data bits: 5, 6, 7, or 8.
 stop bits: 0 or 1.
 parity: 'none', 'odd' or 'even'.
 flowcontrol: 'none', 'hard' or 'soft'.
 rtscontrol: 'none', 'hard', 'soft', or 'best'.
    - [data, nbBytesReceived] = readPort(id, numBytesToRead) read data.
    - writePort(id, data) write data on serial port. data must be uint8 or
char.
    - closePort(id) closes an port opened.
    - flushPort(id) flushs desired port.
    - st = getPortConfig(id) returns struct with port informations.
            
Files (1)
[68.75 kB]
Source code archive

News (0)
Comments (3)     Leave a comment 
Comment from jdjd ndnd -- March 23, 2023, 01:58:01 PM    
This comment has been deleted.
Comment from jdjd ndnd -- March 23, 2023, 02:08:29 PM    
Hi,

I dowloaded cserial file from GitHub.

I ran builder.m in Matlab and it was succesfull. But I have problems with functions.
I got available port with getPortNames() function but then it's over.
I ran example file and I get this error.

Error using openPort
Cannot open serial port.

Error in example (line 9)
writerPort = openPort(ce{2}, baudrate);


Also I tried to exectue this row only:
id = openPort('COM3',115200,[ 8, [ 1, ['none', ['none',
['none']]]]])

Again I get error -> Error using openPort. Unsupported data bits value.

Any idea what's the problem?
Comment from jdjd ndnd -- March 23, 2023, 02:14:21 PM    
Then I also tried to execute builder.sce in Scilab (version 6.1.1).
I can't install atoms for cserial and builder does not execute at all.
I tried with CMake in Visual Studio Community 2019 and installed C compiler in Scilab.
I'm using TDM-GCC (64x) 10.3.0. Makes no difference, still not working. I get this
error.

  "------------- Link files --------------"                                      
       
  "Creating library file: mexsciopenPort.aopenPort.o:openPort.c:(.text+0x507):
undefined 
reference to `__imp_c_serial_is_open'"
  "openPort.o:openPort.c:(.text+0x51e): undefined reference to
`__imp_c_serial_free'"    
  "openPort.o:openPort.c:(.text+0xb0e): undefined reference to
`__imp_c_serial_new'"     
  "openPort.o:openPort.c:(.text+0xb38): undefined reference to 
`__imp_c_serial_set_port_name'"
  "openPort.o:openPort.c:(.text+0xb5b): undefined reference to
`__imp_c_serial_open'"    
  "openPort.o:openPort.c:(.text+0xb8f): undefined reference to 
`__imp_c_serial_set_baud_rate'"
  "openPort.o:openPort.c:(.text+0xba8): undefined reference to 
`__imp_c_serial_set_data_bits'"
  "openPort.o:openPort.c:(.text+0xbc1): undefined reference to 
`__imp_c_serial_set_stop_bits'"
  "openPort.o:openPort.c:(.text+0xbda): undefined reference to
`__imp_c_serial_set_parity'"
  "openPort.o:openPort.c:(.text+0xbf3): undefined reference to 
`__imp_c_serial_set_flow_control'"
  "openPort.o:openPort.c:(.text+0xc0c): undefined reference to 
`__imp_c_serial_set_rts_control'"                                                
                                 
ilib_compile: Error while executing Makelib.
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.