Can someone please help me with the proper syntax to call a program from the 'main' program in ST on the PLC IDE?
I know this is remedial, but I have been searching and searching and I have not yet found a resource. In other IEC 61131-3 environments that I have worked in (Codesys and TwinCAT) I would use something like:
Subprogram();
But in PLC IDE it appears to think that it is looking for an uninitialized function:
main(16) - error S1305: Subprogram => Unknown function
UPDATE:
I removed the 'call' to the subprogram from the main program, and the code in both programs is running. The sup program seems to get executed with the same priority as the main program.
New question: is there a way to have a true main program with subprograms that I can call only when I want to?
Thanks for taking the time to take a look! That is exactly the kind of thing that I am used to doing, which further supports how common a task that it is. Unfortunately, that article is not about the Arduino PLC IDE. Also, I am working in Structured Text (ST) rather than Ladder Diagram (LD), though if it is possible in ladder, I am sure that it can be don in structured text as well.
I am not familiar with Statement Lists specifically. Structured Text is one of the six (five) languages defined in the IEC 61161-3 standard. They are Ladder Diagram (LD), Functional Block Diagram (FBD), Structured Text (ST), Instruction List (IL) Sequential Function Chart (SFC) and Continuous Function Chart (CFC). I think CFC is obsolete. According to WikipediaIEC 61161-3 was released in '93, so Statement List was probably a precursor.
Most of these languages are graphical. I have only programmed in ladder and structured text. The others are Greek to me. Structured text is text based and is the most similar to languages like Arduino or C++.