Skip navigation.
Home
The QNX Community Portal

View topic - out8 function problem in Phab

out8 function problem in Phab

Isn't the name clear?

out8 function problem in Phab

Postby Yelzhan » Mon May 16, 2011 12:30 am

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.
Yelzhan
Yelzhan
New Member
 
Posts: 1
Joined: Mon May 16, 2011 12:06 am

RE: out8 function problem in Phab

Postby mario » Mon May 16, 2011 1:54 pm

Make sure you run the program as root and call ThreadCtl to get the proper permission.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: out8 function problem in Phab

Postby maschoen » Thu May 19, 2011 5:30 am

Yelzhan wrote:When functions out8() and in8() which are for sending and polling data via the parallel port are used in Phab the Application closes down.

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().

Could it be that Photon resets the printer driver when application runs?

No!

Mario's comments cover the usual problems with port I/O.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 2 guests