out8 function problem in Phab

Hi QNX Community!

I wrote the code for controlling the external hardware via the parallel port.
It worked fine in the terminal window. (“slay devc-par” was used to disable printer driver)

But when implementing this program in Phab i faced the problem!!!
When functions out8() and in8() which are for sending and polling data via the parallel port are used in Phab the Application closes down.

Could it be that Photon resets the printer driver when application runs?
What could cause that problem?

Thanks for your help and answers.

Make sure you run the program as root and call ThreadCtl to get the proper permission.

What do you mean “closes down”. If you mean it hangs, well if you are polling inside the main thread of a photon program, that will happen.
Create a 2nd thread, hopefully at a lower priority and/or with more than one processor. Be aware that if you are not in the main thread and you want to call widget functions, you will need to bracket the calls be PtEnter() and PtLeave().


Mario’s comments cover the usual problems with port I/O.