This is to share an experience for "first time" users of SYNASER under Linux
:

 

whenever the code SER.CONNECT('/dev/ttyXXX') is used, a file
"/var/run/lock/lck..ttyXXXX" will be created (XXXX stands for the specific
serial port).

The existance of this file makes sure, that the port cannot be seized by any
other process anymore.

 

whenever your code stops after this instruction (SER.CONNECT.) either by a
runtime error or if you stop it with the debugger, without executing
"SER.CloseSocket" 

this port will remain permanently locked and you will not be able to use it
anymore. (Reboot exempted)

 

The solution is, to manually delete the lck..ttyXXX file and re-execute the
code (making sure that next time the port is released with the
SER.CloseSocket instruction).

 

Example:

----------------------------------------------------------------------------
--

ser:=TBlockSerial.Create;

ser.Connect('/dev/ttyUSB0');   //this will create the lock file

ser.Config(38400,8,'N',SB1,False,False);

x:=1/0;  //example for runtime error

ser.CloseSocket;  //this will delete the lock file and release the port

----------------------------------------------------------------------------
--

 

Result : even if you remove the code line with the runtime error (X:=1/0)

next time, the port cannot be opened, because the LOCK file still exists.

So you have to delete it manually before you can continue.

 

Another way to get around this, could be setting the property
ser.LinuxLock=False during debugging of your code.

 

Hope this helps others to avoid the problems that I had.

 

Sporex

 

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to