Skip navigation.
Home
The QNX Community Portal

View topic - How update analog values to a text label

How update analog values to a text label

Isn't the name clear?

How update analog values to a text label

Postby pradeep » Thu May 03, 2012 12:11 pm

Hi,

I am presently working on a project which has many digital and analog inputs, with digital i have no issues but where as analog values(like pressure etc) are always changing i need to display these values continuously.
For digital values i have used the shared memory as medium between digital module and GUI that is i have read values from Digital cards and updated the shared memory and my GUI reads that particular shared memory and updates the GUI, but the same thing when i do with the analog values GUI is being terminated.
Please suggest a method by which i can update analog values on the qnx label in my GUI screen.
pradeep
Active Member
 
Posts: 20
Joined: Tue Aug 09, 2011 7:17 am

Re: How update analog values to a text label

Postby maschoen » Fri May 04, 2012 7:18 am

It's not really clear from your post where your problem lies.

On one hand it sounds like you are having a problem accessing shared memory.

On the other hand it sounds like you are having trouble figuring out how to show an
analog value. What does it mean to update an analog value on a qnx label?
Do you mean something like:

sprintf(buffer,"%f",value);
PtSetResource(label_widget,PtTextString,buffer,0);
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Re: How update analog values to a text label

Postby pradeep » Fri May 04, 2012 10:06 am

Thanks for the quick reply,

I finally got solution to the problem, I used PtTimer and have written all the GUI update commands in that timer callback now timer runs continuously and updates the individual labels in GUI without effecting the main GUI.

I have also used the syntax specified by you to print the values in the qnx label.

Thanks and regards
pradeep
pradeep
Active Member
 
Posts: 20
Joined: Tue Aug 09, 2011 7:17 am


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 4 guests