Codesys SVN
CODESYS Forge
talk
(Thread)
Codesys SVN
Last updated: 2024-05-02
Post by esave on Softmotion Light Problem: The license is missing or invalid
CODESYS Forge
talk
(Post)
Hello everybody I want to controll a stepper driver from Leadshine (EM3E-556E). The EtherCat slave is CiA 402 compatible. Because of this I bought the Softmotion Light Package from Codesys and implemented it in my project. I rightclicked the EtherCat slave and added the Softmotion Light axis. But now the error message shows: "The license is missing or invalid. The PLC runs in demo mode." What have i done wrong? I use Codesys 3.5.17. Is it possible that the stepper driver is not compatible with the Softmotion license? Thanks for all your help
Last updated: 2024-05-02
Softmotion Light Problem: The license is missing or invalid
CODESYS Forge
talk
(Thread)
Softmotion Light Problem: The license is missing or invalid
Last updated: 2024-05-02
Post by tvm on Discussion for Home page
JSON parsing and composing library
home
(Post)
Correct. In an actual use case I think the compose and parse would happen on different machines.
Last updated: 2024-05-02
Post by maxkemmeren on Discussion for Home page
JSON parsing and composing library
home
(Post)
sFileContentsWrite_Struct : ST_TEST; sFileContentsWrite_Struct_Json : ST_TEST_Json; sFileContentsRead_Struct_Json : ST_TEST_Json; sFileContentsRead_Struct : ST_TEST; sFileContentsWrite_Struct_Json.fReal.Number := sFileContentsWrite_Struct.fReal; sFileContentsWrite_Struct_Json.nInteger.Integer := sFileContentsWrite_Struct.nInteger; sFileContentsWrite_Struct_Json.sText.CharString := sFileContentsWrite_Struct.sText; sFileContentsWrite_Struct_Json.fLreal.Number :=sFileContentsWrite_Struct.fLreal; s_fbJsonParser( Execute := Execute, Abort := Abort, JSONString := ADR(JsonString), JSONStringSize := SIZEOF(JsonString), JSONVars := ADR(sFileContentsWrite_Struct_Json), NumberOfVars := SIZEOF(sFileContentsWrite_Struct_Json)/SIZEOF(JSONVAR), VariableArraySize := TRUE, Format := false, Busy => Busy, Done => Done, Aborted => Aborted, Error => Error, ErrorPosition => ErrorPosition, ComposeTime => ComposeTime); s_fbStructParser( Execute := rExecute, Abort := rAbort, JSONString := ADR(JsonString), JSONStringSize := SIZEOF(JsonString), JSONVars := ADR(sFileContentsRead_Struct_Json), NumberOfVars := SIZEOF(sFileContentsRead_Struct_Json)/SIZEOF(JSONVAR), Busy => rBusy, Done => rDone, Aborted => rAborted, Error => rError, ErrorPosition => rErrorPosition, ParseTime => rComposeTime); sFileContentsRead_Struct.fReal := sFileContentsRead_Struct_Json.fReal.Number; sFileContentsRead_Struct.nInteger := TO_INT(sFileContentsRead_Struct_Json.nInteger.Integer); sFileContentsRead_Struct.sText := sFileContentsRead_Struct_Json.sText.CharString; sFileContentsRead_Struct.fLreal := sFileContentsRead_Struct_Json.fLreal.Number; TYPE ST_TEST : STRUCT sText : STRING := 'Hello test'; nInteger : INT := 10; fReal : REAL := 1.234567; fLreal : REAL := 1215.2215; END_STRUCT END_TYPE TYPE ST_TEST_Json : STRUCT thisisnew : JSONVAR; sText : JSONVAR; nInteger : JSONVAR; fReal : JSONVAR; fLreal :JSONVAR; END_STRUCT END_TYPE This is using only your blocks writing the json string and then parsing back the json string to the same struct. Without the exit change the read struct stayed empty
Last updated: 2024-05-02
Post by maxkemmeren on Discussion for Home page
JSON parsing and composing library
home
(Post)
I Found my thinking mistake. You made it that you can onlyh parse from and to a struct of the same instance name. In my example I parse a writing struct and than parse it back into a reading struct of the same type. But as the writing and reading struct have different instance names this match all levels does not become true making the reading struct empty. So parsing to and from 1 struct instance will work.
Last updated: 2024-05-02
Post by tvm on Discussion for Home page
JSON parsing and composing library
home
(Post)
The EXIT is in the correct place in the original, this is not a bug. The loop returns FALSE and exits on the first occurrence of a mismatch. If there are any mismatches, there is no point in evaluating the rest of the array. All levels must match for this method to return TRUE.
Last updated: 2024-05-02
Post by maxkemmeren on Discussion for Home page
JSON parsing and composing library
home
(Post)
OKay but then there must be another error, as after the change the functionblock read all the values into my local struct. Without the fix my local struct stayed empty all the time.
Last updated: 2024-05-02
Post by tvm on Discussion for Home page
JSON parsing and composing library
home
(Post)
If you can post an example I can test it here.
Last updated: 2024-05-02
Post by maxkemmeren on Discussion for Home page
JSON parsing and composing library
home
(Post)
SOLVED SEE REPLIES NOT A BUG, Different thinking approach Hello, There is still a bug within the Json_TO_Struct FB. Within the method MatchAllLevels: The EXIT Statement was in the wrong place within the for loop. As the loop needs to be exited when a match is found. The bug caused the matchalllevels method to always feedback the value false due to the exit statement. When placing the exit after match is set to true the values are parsed into the struct. --------------------------------------OLD----------------------------------------------------------- FOR i:= 1 TO obj_level DO //Match name and array index. Array index will be 0 if the current name:value is not part of an array IF MATCH_NAMES(i_JSONVar.Names[i], NameValue[obj_level-(i-1)]) THEN MatchAllLevels:= TRUE; //name in JSON string matches the local variable name ELSE MatchAllLevels:= FALSE; //name in JSON string does not match the local variable name, go to next name EXIT; END_IF END_FOR --------------------------------------NEW----------------------------------------------------------- FOR i:= 1 TO obj_level DO //Match name and array index. Array index will be 0 if the current name:value is not part of an array IF MATCH_NAMES(i_JSONVar.Names[i], NameValue[obj_level-(i-1)]) THEN MatchAllLevels:= TRUE; //name in JSON string matches the local variable name EXIT; ELSE MatchAllLevels:= FALSE; //name in JSON string does not match the local variable name, go to next name END_IF END_FOR
Last updated: 2024-05-02
Post by tvm on Discussion for Home page
JSON parsing and composing library
home
(Post)
Check any of your JSONVARs. The Names variable contains an array of the variable name divided by level. For example, if the variable path is Application.Test_SingleVar_PRG.colour, then the array will contain [3] 'Application' [2] 'Test_SingleVar_PRG' [1] 'colour' The ApplicationLevel property should be the array index which contains 'Application', in this case 3. This is all figured out in the JSONVAR.FB_Init method. The other place to check is JSONVAR.VarName, which is the full instance path of the variable as a string. The string length is set in GPL_JSON.MAX_VAR_NAME, by default 150 characters. Maybe your path is longer than 150 characters and something is getting cut off?
Last updated: 2024-05-02
wiki Discussion
eziomori
wiki
(Discussion)
Forum for wiki comments
Last updated: 2024-05-02
blog Discussion
eziomori
blog
(Discussion)
Forum for blog comments
Last updated: 2024-05-02
(no subject)
eziomori
wiki
(Thread)
Last updated: 2024-05-02
Home
eziomori
wiki
(WikiPage)
Project Members: eziomori (admin)
Last updated: 2024-05-02
wiki Discussion
artirvin
wiki
(Discussion)
Forum for wiki comments
Last updated: 2024-05-02
blog Discussion
artirvin
blog
(Discussion)
Forum for blog comments
Last updated: 2024-05-02
(no subject)
artirvin
wiki
(Thread)
Last updated: 2024-05-02
Home
artirvin
wiki
(WikiPage)
Project Members: artirvin (admin)
Last updated: 2024-05-02
Post by rabaggett on CODESYS control for Raspberry Pi 64 SL errors
CODESYS Forge
talk
(Post)
Hi, I am trying to create a project using a raspberry pi, I have added the modules for the Pi and MCP3008. I have encountered som errors that I don't know how to track down. 1. The GPIOs give preprocessor errors, but I read that this does not prevent compiling. This seems to be true. I can build the empty project with no errors. 2. After adding a SPI master and MCP3008, the preprocessor errors double, but seem similar and the project again builds with no errors. 3. I add a DUT and GVL, with a function, and I get the following errors. They remain even if I delete these things. ------ Build started: Application: Device.Application ------- Typify code... [ERROR] crr: C0032: Cannot convert type 'Unknown type: 'ADR(GVL_Io_17160064_c083_41f8_9e53_208be7537753_HPS_7.Io_17160064_c083_41f8_9e53_208be7537753_HPS_7)'' to type 'POINTER TO IoConfigParameter' [ERROR] crr: C0077: Unknown type: 'GVL_Io_17160064_c083_41f8_9e53_208be7537753_HPS_7.Io_17160064_c083_41f8_9e53_208be7537753_HPS_7' [ERROR] crr: C0046: Identifier 'GVL_Io_17160064_c083_41f8_9e53_208be7537753_HPS_7' not defined Compile complete -- 3 errors, 0 warnings I attach the project. What am I doing wrong? Thanks!
Last updated: 2024-05-02
wiki Discussion
willarama1991
wiki
(Discussion)
Forum for wiki comments
Last updated: 2024-05-02
blog Discussion
willarama1991
blog
(Discussion)
Forum for blog comments
Last updated: 2024-05-02
Home
willarama1991
wiki
(WikiPage)
Project Members: willarama1991 (admin)
Last updated: 2024-05-02
(no subject)
willarama1991
wiki
(Thread)
Last updated: 2024-05-02
Post by rabaggett on CODESYS control for Raspberry Pi 64 SL errors
CODESYS Forge
talk
(Post)
Update: I found my error in the Scale function, where I used UINT_TO_REAL instead of DWORD_TO_REAL. I fixed it, errors unchanged.
Last updated: 2024-05-02