Matching PLC and Qt C++ Client

andreahmed

Member
Join Date
Jul 2017
Location
vienna
Posts
5
I'm running a PLC simulation software and I have a client Qt, I get the data which is a temperature from the PLC and it's running its own internal operating system. At Qt client I'm running a thread every 1 second and I plot the temperature and the time, but its not accurate, how would I sync the data with the plc simulation software

In PLC

timer(IN := TRUE, PT:=tAbsoluteTime);
IF(timer.Q) THEN
rT := rT + 1/TIME_TO_REAL(tAbsoluteTime);
rOut := (1 - rT) * sPoints[iStartIndex].rTemperature + rT * sPoints[iEndIndex].rTemperature;
IF(rOUT > 0) THEN
bStartCounting := TRUE;
END_IF
timer.IN := FALSE;
rTickCount := rTickCount + 1;
END_IF
In Qt, I'm just running a timer with T = 1 Second and I'm reading rOut from it.
 
What PLC simulation software are you using?

How are you interfacing the PLC and the client?

How accurate do you need it to be?
 
In order to sync the data from the PLC, I would write the value to a variable and then increment an pointer to the next variable location for storage.

The software will then read pointer address. If it is greater then the first location then read the data value(s) and reset the pointer address.

Regards,
 
Update a transaction number in the PLC each time you update the temp. Then the PC can tell if the data has been updated and you can poll it more often than once a second.
 

Similar Topics

After great help on the forum getting a Red Lion G3 HMI to control & communicate with Advantech's ADAM-4055 D/IO modules, the next step was to...
Replies
15
Views
4,325
Hello. I have a Power Flex 755 that is pulling material (fpm) across conveyor rollers that are controlled by a Powerflex 525 (rpm). I am probably...
Replies
17
Views
4,838
I have a 1771-IFE/C analog card where the data that is showing in the I/O config is not matching what is the actual register that the data is...
Replies
2
Views
1,412
I have a scenario (it's a game) where the player has a dozen phone jacks (think 1/4" headphone, not telephone) and a half dozen patch cables that...
Replies
16
Views
7,628
When I save RS Logix 500 files in the projects folder normally I can select the latest and go online with all comments and such but sometimes If...
Replies
2
Views
3,053
Back
Top Bottom