marke Posted January 5, 2012 Report Share Posted January 5, 2012 I have just solved a problem that had me stumped for quite a while. I am writing some software using scripted text in CScape 9.20 SP2 I have a number of modules and am beginning to add the real detail of the control systems.On trying to add a write to removeable media, I kept on getting errors on test for errors.I had defined all the arguments used in this function block and could not see why the error was occuring.The error was :MainSFCMainSFC: GS401-P0(1): Argument has a wrong typeMainSFC: GS401-P0(1): ,: “END_ACTION” expected after action blockMainSFC: GS401-P0(1): ,: Invalid statement in SFC actionMainSFC: GS401-P0(1): END_ACTION: Invalid statement in SFC action which strongly implied that one of the arguments was not correctly defined. The arguments must be defined as variables in the appropriate section, or in the global section including, the function block itself.(I tried using Ladder with the same result) My line of code that was creating problems is :WR(True,CF_CREATE,CF_UINT,'\setting.csv',W_Src,INT#40,INT#10,CF_CSV,False); The issue was that the source of the data is defined as W_Src and I defined that is an integer because the data is all integers.I have a Tag address which determines where the data starts. The trap however, is that this is a block of data so you need to also define the dimensions in the "DIM" field of the program variables table. WR(EN,#MODE,#TYPE,FILENAME,SRC[],NUM,COL/ROW,#FILETYPE,#ENDOFROW); In the Help file, the the variable is SRC[]. You NEED to define DIM ensions in the variable definition for this to work!! This also applies to other function blocks such as PID controllers etc. Best regards,Mark. Mark Empson | administratorSkype Contact = markempson | phone +64 274 363 067LMPForum | Power Factor | L M Photonics Ltd | Empson family | Advanced Motor Control Ltd | Pressure Transducers | Smart Relay | GSM Control | Mark Empson Website | AuCom | Soft Starters Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now