I seem to be having an issue understanding why my code won’t compile, this code is in a block within a subroutine.
below I have posted my code along with the compilation errors
// if Ramp start > Setpoint move analog to set point (this prevents unexpected ramping to 100%)
if (*pft_Setpoint[*pn_Index] <= *pft_RampStart[*pn_Index]) then
*pao_AnalogOutput = pft_Setpoint[*pn_Index];
else
// Start analog point at ramp start
*pao_AnalogOutput = *pft_RampStart[*pn_Index];
//ramp analog to setpoint
RampAnalogOutput(*pft_Setpoint[*pn_Index], *pft_RampRate[*pn_Index], *pao_AnalogOutput);
endif
Compiling…
Error on line 2: syntax error at or near “[”
Error on line 2: syntax error at or near “)”
Error on line 3: syntax error at or near “[”
Error on line 8: syntax error at or near “[”
Error on line 8: syntax error at or near “,”
5 error(s), 0 warning(s)
It may be with the way I am using pointers, if you have any idea why I am having these issues please reply!
Maybe its just confused and might need to be broken down a bit.
How about making a integer variable idx, then do idx = *pn_Index;
[idx] instead of [pn_Index]
See if that helps.
I was thinking of doing this but was hoping I could avoid doing that, how my subroutine is setup is I pass about 12 arguments through a pointer table then I have pointers within the subroutine to take those values so I can dereference and utilize them.
pao_AnalogOutput is set to point to an analog output
pft_Setpoint was set to Down Timer, I fixed it and made it point to a float table
pn_Index is set to point to Integer 32 Variable
pft_RampStart is set to point to float table
Thank you so much turns out it was because of pft_Setpoint pointing to the wrong datatype