Author Topic: Chart by array  (Read 990 times)

StefanA

  • Newbie
  • *
  • Posts: 33
    • View Profile
Chart by array
« on: August 20, 2016, 05:06:10 AM »
I want to use the Chart By Array function together with the Modbus protocol but I'm a bit confused about how to use i when it comes to the array part and the holding registers my samples are stored in.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5306
    • View Profile
    • AdvancedHMI
Re: Chart by array
« Reply #1 on: August 20, 2016, 08:32:18 AM »
The ChartByArray was originally designed for a batch process. Here would be an example of using ChartByArray. Let's say you have a batch mixer and you want to chart the power used by the motor at 3 second sample intervals. Register 40001 will be used as the index, so it will reset to 0 at the start of the batch and increment every 3 seconds when the mixer is running. Just before incrementing 40001, you will store the motor power in the register 40100 plus the value in 40001 as an indirect index. The first sample would store in 40100, three seconds later a sample in 40101, six seconds a sample in 40102, etc.

Here is how you then setup the ChartByArray:

- Register 40001 would be put in PLCAddressArrayIndex
- In PLCAddressItems, add an item with PLCAddress set to 40100

As the program runs, it will monitor the value in PLCAddressArrayIndex. As the value increments, it will read the values starting in 40100 up to the current array index value, then chart the values.