PtProgress problems

Can anyone explain to me how the output from the following code could
possibly be:

water level value set = 5
water level value read = 100

because it is.

ABW_waterLevel is a PtProgress.

I’m running RTP 6.1.

Thanks much for any help.

-Dan


long tmpWaterLevel;
const long * waterLevelRead;


PtEnter(Pt_EVENT_PROCESS_PREVENT);
{

sprintf(recMsg, “water level value set = %ld\n”, tmpWaterLevel);
PtMultiTextModifyText(ABW_msgTxt, 1, 1, -1, recMsg,
sizeof(recMsg), NULL, 0);

PtSetResource(ABW_waterLevel, Pt_ARG_GAUGE_VALUE,
&tmpWaterLevel, 0);

PtGetResource(ABW_waterLevel, Pt_ARG_GAUGE_VALUE,
&waterLevelRead, 0);

sprintf(recMsg, “water level value read = %ld\n”, *waterLevelRead);
PtMultiTextModifyText(ABW_msgTxt, 1, 1, -1, recMsg,
sizeof(recMsg), NULL, 0);

}
PtLeave(Pt_EVENT_PROCESS_PREVENT);