Jump to content
OMRON Forums

nocturnalz

Members
  • Posts

    2
  • Joined

  • Last visited

nocturnalz's Achievements

Newbie

Newbie (1/14)

  • One Month Later
  • First Post
  • Week One Done
  • Conversation Starter

Recent Badges

0

Reputation

  1. Hi DonNH, Thank you for replying - much appreciated. Yes, you are correct on the variable definition/declarations and workflow. It took a long struggle to get myself up to speed in understanding how the development flow iss in Sysmac. My mistake was that I thought that ST was a well-defined IEC standard (I think I came across two other videos where the softwares used a similar structure in declaration and code paradigm) - so I thought Sysmac would be something similar. I also kept thinking along the lines of a standard C/C++ type coding scheme. 'Love the software and love the environment now that I'm becoming accustomed to it. BUT I'm still a newbie. Good luck in your work and all the best.
  2. Hi everyone, I'm new to PLC development, specifically, this question pertains structural text program-only workflow. I’m currently trying to get together a basic workflow for creating a structural text program-only based environment in Sysmac Studio. My setup is: NX1P2-9024DT1 Sysmac Studio v1.54 Windows 11 Pro I’ve been able to create a new project -> delete the default ladder program0 -> add in a new ST program0 -> and pasted the following: IF (InputSignal = TRUE) THEN BIO_Output_Bit_00 := TRUE; // Turns on '00' output BIO_Output_Bit_09 := TRUE; // Turns on '09' output ELSE BIO_Output_Bit_00 := FALSE; BIO_Output_Bit_09:= FALSE; END_IF; And I can add in an HMI with a linked-InputSignal button and linked-BIO_Output_Bit_00 and it will simulate with no issues. However, I’m trying to achieve a basic hello world-like skeleton ST base script where there is a program entry, variable declarations, etc. In C, it would be the equivalent: #include <headers> #global variables here… int main() { # some local variables # main code, etc… } In the case of Structural Text, I’ve been reading online and seeing in tutorials, the basic program appears to be: PROGRAM Main VAR Counter: INT := 0; END_VAR METHOD IncrementCounter : BOOL Counter := Counter + 1; RETURN TRUE; END_METHOD METHOD MainTask : BOOL IF IncrementCounter() THEN // Do something when the counter is incremented successfully END_IF RETURN TRUE; END_METHOD However, when I try to add this code or anything similar, Sysmac Studio does not recognize the PROGRAM or VAR/END_VAR or METHOD/END_METHOD keywords. I’ve gone into more detail in W501 – NJ/NX-series CPU Unit Software User’s Manual but it provides usage details for the different variable types, constructs and expression definitions etc. There isn’t details on how to set-up a generic program and how to implement it into a new project. Is there any literature separate from W501, are you able to provide an example ST project script that can demonstrate what I am trying to achieve? My guess is that it should be possible – I’ve seen MATLAB generated PLC ST code that uses the VAR/END_VAR, FUNCTION_BLOCK/END_FUNCTION_BLOCK etc keywords and simulated with no errors. Probably an implementation detail on my end(?). Please and thank you – much appreciated in advance for your help/assistance. Regards, Ron.
×
×
  • Create New...