Hi list...<br><br>This comes from the help forum:<br><br>Zoltan said:<br><p><i>"In ktechlab's source you can find in /src/electronics/port.h and .cpp the implementation. </i></p>

<p><i>As I see, reading and writing is done by calling ioctl on the device. </i></p>

<p><i>I don't know if setting the voltage on the port and seeing the
change in ktchlab should work or not, but in my opinion it shouldn't be
a something very complicated to do."</i></p><i></i><p><br></p><p>Ok... i had a look to port.cpp, and also to /src/electronics/components/parallelportcomponent.ccp and serialportcomponent.cpp<br></p><p>Setting the voltage on the port works ok in serial port, but not with every pin.. in the code these inputs are comented as "doesn't work", all of them should work,  but at least some of them works; but in parallel port, inputs (status) don't work, i think they should... i didn't find any problem in the code; i don't know very well the ioctl library, but all looks correct.</p>
<p>Anyway i will try to find the problem.<br></p><p>I found that data and control were also defined as inputs, but working like outputs ; i think this makes some erratic behaivors. (from the port point of view... an input to the port is "outputed" to ktechlab, then in ktechlab is defined as "createLogicOut"). <br>
</p><p>I did some changes in parallelportcomponet.cpp and .h and i think now is working ok (data & control). I also did a workaround to solve the inverted values shown in ktechlab compared with the values present in the port, and now works ok for me.<br>
</p><p>I think this is a very interestin feature, because is possible to interface  a real circuit with a virtual one running in Ktechlab...</p><p>I'm thinking in not simulate PIC but run the code in a real pic and conect it to a virtual circuit through parallel port. I did a try with a real pic managing a virtual led in kltechlab through serial port, working ok; but serial has just a few lines, with parallel i could interface two whole ports.</p>
<p>I keep learning about ioctl... lets see if i find the way.<br></p><p><i><br></i></p>