Skip navigation.
Home
The QNX Community Portal

View topic - How update analog values to a text label

Page 1 of 1

How update analog values to a text label

PostPosted: Thu May 03, 2012 12:11 pm
by pradeep
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.

Re: How update analog values to a text label

PostPosted: Fri May 04, 2012 7:18 am
by maschoen
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);

Re: How update analog values to a text label

PostPosted: Fri May 04, 2012 10:06 am
by pradeep
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