Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Dynamically accessing AArray100 in Plc

Dynamically accessing AArray100 in Plc 3 years 10 months ago #10657

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
For an object like AArray100, how may I specify reading and writing to index-parameterized selected elements in the Plc coding environment? The Mux object is cumbersome and only addresses 24 items total.
The administrator has disabled public write access.

Dynamically accessing AArray100 in Plc 3 years 10 months ago #10660

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
I wrote a 'hack' that works using CArithm - but I would feel more secure using a designated ProviewR method.
(Take the address in C of element 0, assign a pointer as an array and index it with an integer)
The administrator has disabled public write access.

Dynamically accessing AArray100 in Plc 3 years 10 months ago #10662

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3176
  • Thank you received: 502
  • Karma: 133
Hi Bruce,

You can use a DataArithm and fetch a pointer to the AArray with a GetData and connect to the Da1 input. The code would be something like
classdef Da1 AArray100;

for (i = 0; i < 100; i+)
  Da1->Value[i] = ...

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: Bruce@Spang
  • Page:
  • 1
Time to create page: 8.601 seconds