Given that VariableID is a uint.
Can I use save a VariableID to a unit varaible then use this like a pointer.
i.e
void main
{
uint a = VariableIDs.example;
float b;
smRead(a,b);
}
I am trying to make a CANBUS read/write buffer, and this would allow me to queue system variables in the buffer.
Using VariableID as Pointer
- CustomFP
- Posts: 41
- Joined: Thu Mar 22, 2012 4:12 pm
- boyce
- Enovation Controls Development
- Posts: 322
- Joined: Wed Sep 08, 2010 5:09 pm
Re: Using VariableID as Pointer
Yes, that looks like it will work fine. Since you are doing a queue, you can use an array for your buffer. Something like:
void main
{
uint a;
double[] b(20);
a = VariableIDs.example;
// Your code could have a loop and an index.
smRead(a, b[0]);
smRead(a, b[1]);
}
void main
{
uint a;
double[] b(20);
a = VariableIDs.example;
// Your code could have a loop and an index.
smRead(a, b[0]);
smRead(a, b[1]);
}
Boyce Schrack
Enovation Controls
Enovation Controls