Questions about usage of the system and tools

Hardware control

Postby rnol » 25. Mar 2009, 16:53

I would like to know if there are any classes available for control of the serial or parallel ports -- or better yet memory locations as would be requird to access Digital contol IO cards.

Thanks
rnol
 
Posts: 2
Joined: 24. Mar 2009, 17:55

Re: Hardware control

Postby jan_vrany » 30. Mar 2009, 10:21

I don't know any classes for that - or at least any classes in publicly available
St/X version. On UNIX you can communicate directly via /dev/ttyS0 or similar. Unfortunately,
there is no generic ioctl() interface. For accessing specific memory locations, it might be possible to use ExternalBytes class with address set to the begining of the given memory location.

Another solution is to write a tiny C library and call that library using FFI.
jan_vrany
 
Posts: 28
Joined: 10. Dec 2008, 12:37

Re: Hardware control

Postby rnol » 1. Apr 2009, 21:26

Thanks
I will explore the FFI option.
rnol
 
Posts: 2
Joined: 24. Mar 2009, 17:55

Re: Hardware control

Postby jan_vrany » 1. Apr 2009, 23:02

OK. Please note, that FFI in 5.4.2 is broken (when C function returns a pointer, the highest bit lost and
thus the returned value becomes unusable. 5.3.6 release is perfectly OK.
(this bug is fixed in ExternalBytes.st r1.72)
jan_vrany
 
Posts: 28
Joined: 10. Dec 2008, 12:37


Return to General Help

Users browsing this forum: No registered users and 2 guests

Design by GB