Author Topic: ChartByArray  (Read 2872 times)

BLFTech

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • BLF-Tech LLC Website
ChartByArray
« on: February 14, 2016, 03:45:08 PM »
Can you elaborate more on using the ChartByArray trend control?

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: ChartByArray
« Reply #1 on: February 14, 2016, 04:44:59 PM »
There is some info in this topic:

http://advancedhmi.com/forum/index.php?topic=821.0

as well as the topic where you posted a question:

http://advancedhmi.com/forum/index.php?topic=1134.0

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: ChartByArray
« Reply #2 on: February 14, 2016, 04:50:21 PM »
Probably the best way to explain the ChartByArray is to describe the two applications it was developed for.

The ChartByArray was first created for a cooker that would record temperature, pressure, and steam output in arrays. It was a batch process that would reset the data recording each time a new batch was started. It used an index variable that pointed the the next element in the arrays to be used for a data sample. Every 15 seconds the process values were sampled and stored in the arrays in the current index position then the index variable was incremented. Using PLCAddressItems, each array was added to the list. Then the index variable was set in PLCArrayIndex. When the variable PLCArrayIndex went to 0 (actually it watched for it to reduce in value), then chart was cleared. Each time the index incremented, it would read the values from the arrays and add them to the chart. The result was a chart that would get new values added as the process was running and that would show the complete process after it was finished a batch.

Another application was for a machine that would weigh small batches of material. Each time a weigh out was completed, a data table with 50 elements was shifted (discarding element 50) and the latest weight stored in element 0. The data table address was added to PLCAddressItems. A bit value in the PLC was set to 1 each time a new weight value was added to the table. The address of the bit value was put in PLCAddressRefreshAllPoints. When the ChartByArray saw this bit go true, it would read the complete array and plot the values. The result was a chart showing the last 50 weights.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: ChartByArray
« Reply #3 on: February 14, 2016, 04:54:56 PM »
Also note the ChartByArray is directly based on the Microsoft Chart, so you can find a lot of in depth information on setting up how the chart looks and other things from here:

https://msdn.microsoft.com/en-us/library/dd489238.aspx

BLFTech

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • BLF-Tech LLC Website
Re: ChartByArray
« Reply #4 on: February 14, 2016, 05:11:52 PM »
Thanks Archie, I wasn't clear on the PLC tags you had in the control properties. Your comments and Godra directing me to another post has cleared it up.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: ChartByArray
« Reply #5 on: February 14, 2016, 05:55:13 PM »
Two other things I did not mention:

- If you do not use PLCAddressArrayIndex, then you will need to put a value in the Property ArrayIndex
- If you want to refresh the chart via HMI code, then you can set the Property RefreshAllPoints to True and back to False like this:

ChartByArray1.RefreshAllPoints=True
ChartByArray1.RefreshAllPoints=False

bachphi

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: ChartByArray
« Reply #6 on: August 07, 2020, 11:44:32 AM »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================