In case anyone else runs into this problem, this is a bug in Schneider Electric's latest release of Machine Expert (v2.0.2) BIT types can't be used in Persistent Variables
I have a very basic program, consisting of a single structure in persistent memory: TYPE SETPOINTS : STRUCT Bit0: BIT; Bit1: BIT; Bit2: BIT; Bit3: BIT; Bit4: BIT; Bit5: BIT; Bit6: BIT; Bit7: BIT; END_STRUCT END_TYPE PROGRAM SR_Main VAR PERSISTENT Setpt: SETPOINTS; END_VAR {attribute 'qualified_only'} VAR_GLOBAL PERSISTENT RETAIN // Generated instance path of persistent variable SR_Main.Setpt: SETPOINTS; END_VAR Is there any reason that a BIT type cannot be stored in persistent memory? Any considerations...
I have a function with an input of ANY type. I have discovered that if an integer type has a subrange, for example: Var1: INT(1..50); then the TypeClass of the ANY variable becomes TYPE_SUBRANGE, instead of its base type. The problem is that it is not possible to determine what type the variable is. I can determine whether it's 8,16,32,or 64 bits using the diSize variable, but there's no way to tell if it's signed or unsigned. Has anyone else run into this? Why would it be designed this way?
I have a function with an input of ANY type. I have discovered that if an integer type has a subrange, for example: Var1: INT(1..50); then the TypeClass of the ANY variable becomes TYPE_SUBRANGE, instead of its base type. The problem is that it is not possible to determine what type the variable is. I can guess whether it's 8,16,32,or 64 bits, but there's no way to tell if it's signed or unsigned. Has anyone else run into this? Why would it be designed this way?
I have a function with an input of ANY type. I have discovered that if an integer type has a subrange, for example: Var1: INT(1..50); then the TypeClass of the ANY variable becomes TYPE_SUBRANGE, instead of its base type. The problem is that it is not possible to determine what type the variable is. I can guess whether it's 8,16,32,or 64 bits, but there's not way to tell if it's signed or unsigned. Has anyone else run into this? Why would it be designed this way?
A couple questions about the use of FbOpenDialogExtended in the Visu Utils library: 1. Does it have to be called from the visualization task? It would seem to make sense, but in the example here: https://forge.codesys.com/prj/codesys-example/visu-dialog-st/home/Home/ it's called from the main task. 2. Can there be multiple instances of this function block? For example, if I have several libraries, and they all use it, would it be better to put it into a GVL somewhere that they can all access the...
With a structure, I can initialize it like this: VAR TestStruct: TEST_STRUCT:= (Item1:= 1, Item2:= 2, Item3:= 3, Item4:= 4, Item5:= 5); END_VAR or I can write to it in a program like this: TestStruct:= STRUCT(Item1:= 1, Item2:= 2, Item3:= 3, Item4:= 4, Item5:= 5); With an array, I can initialize it like this: VAR TestArray: ARRAY[1..5] OF INT:= [1,2,3,4,5]; END_VAR But I can't do this in a program: TestArray:= [1,2,3,4,5]; Is there a way to do this? I understand I can do this: TestArray[1]:= 1; TestArray[2]:=...
In my experience it's usually an uninitialized pointer somewhere. Set a breakpoint in the CheckPointer implicit check function https://help.codesys.com/api-content/2/codesys/3.5.13.0/en/_cds_f_obj_pous_implicit_check/ and/or set "Stop Execution on Handled Exceptions" https://help.codesys.com/api-content/2/codesys/3.5.13.0/en/_cds_cmd_stop_execution_on_handled_exceptions/
Any idea what this is? I get it every time I try to compile a program. The only way around it is to click "Ignore" about 50 times. After that the program compiles and runs fine.
Use {attribute 'VAR_IN_OUT_AS_POINTER'} in the interface of your dialog box. See here: https://help.codesys.com/api-content/2/core_visualization/3.5.16.0/en/_visu_cmd_interface_editor/ And also here: https://forge.codesys.com/forge/talk/Visualization/thread/bcbc83fe88/#6b02
Excellent, glad to hear it. If you're interested in contributing to the library you can contact me directly, my email address is scattered all over the documentation. Some time in the future when I have some time I'd like to figure out how to allow for both STRING and WSTRING types in the same library. Not sure how I'm going to do that yet without creating two entirely separate systems.
In that case, the value is set in JSON_TO_STRUCT, line 110 JSONVars^[jsonvarindex].AsString:= NameValue[obj_level].Value; if you set a breakpoint here, you should be able to step through each name:value pair, and see what's contained in the NameValue array at the one that's not working. The NameValue array is populated in the .Value method, which we've already modified, line 65-70. //copy buffer to temporary value as a string SysMemCpy( pDest:= ADR(NameValue[obj_level].Value), pSrc:= ADR(JSONString^[value_start]),...
I think it must be something in STRING_TO_JSONVALUE function. If JSONVAR.HMIVarAsString is correct, that means the value is correct when JSONVAR.AsString is set. Because all it's doing there is copying the value, since it's already a string. I was using that for a certain HMI that couldn't accept properties, only variables. So, you might want to set a breakpoint in JSONVAR.AsString.Set, and then step through STRING_TO_JSONVAR to see where the limiting is happening. It might be useful to take out...
Did you change it in CharString.Get as well?
OK, what about leaving Size the way it was, and changing: //put data into internal value SysMemCpy( pDest:= ADR(_InternalValue), pSrc:= ADR(CharString), udiCount:= (_Size+1) * 2 ); I can't remember how Size is used elsewhere - it's probably something to do with whether it includes the trailing null character or not.
Size should be doubled I think like this: _Size:= INT_TO_UINT(WLEN(CharString)) * 2;
What about property JSONVAR.CharString? In your new function WSTRING_TO_JSONVALUE, you still have this line. Did CharString get changed to WSTRING type? JSONVALUETYPE_16.json_wstring: Out_JSON^.CharString:= In_WString;
OK, I have another idea. Take a look in JSON_TO_STRUCT.Value, line 65-70 //copy buffer to temporary value as a string SysMemCpy( pDest:= ADR(NameValue[obj_level].Value), pSrc:= ADR(JSONString^[value_start]), udiCount:= MIN((value_stop+1) - value_start, GPL_JSON.MAX_VALUE_SIZE-1) ); this copies bytes from the JSON string into a temporary buffer containing the name and value. The NAMEVALUE buffer should be fine, but the udiCount input to SysMemCpy is in bytes, and should be doubled, I think //copy...
OK, what about in JSONVAR _InternalValue: ARRAY[1..GPL_JSON.MAX_VALUE_SIZE+1] OF BYTE; should that also be changed to a WORD, or is it big enough anyway?
Did you increase the values in the library, or in your project? Because I've noticed in the past that if I change a value in a parameter list in the library, it doesn't change in the project unless I do it there as well
line 41 of JSON_TO_STRUCT limits the loop to either finding a null character, or the total string size. Did you change the ASCII enumeration to WORD?
Try increasing these values in GPL_JSON MAX_NAME_SIZE: UINT:= 20; //max string length of JSON name MAX_VALUE_SIZE: UINT:= 20; //max value size in bytes (all values are this size in memory) These were basically only to limit memory usage. For example, MAX_VALUE_SIZE is the number of bytes that each JSONVAR uses for internal variable storage, regardless of type. So if all your JSON variables are booleans or numbers, it could probably be 4 bytes. In your case, with a lot of strings, it needs to be ...
I think I understand what you're trying to do. It caught my attention because I've done something similar. I set up a test like this: TYPE TEST_STRUCT_1 : STRUCT First: STRING:= 'First'; Second: STRING:= 'Second'; END_STRUCT END_TYPE TYPE TEST_STRUCT_2 : STRUCT Third: STRING:= 'Third'; Fourth: STRING:= 'Fourth'; END_STRUCT END_TYPE TYPE TEST_STRUCT : STRUCT Test1: TEST_STRUCT_1; Test2: TEST_STRUCT_2; END_STRUCT END_TYPE PROGRAM Test_PRG VAR TestStruct: ARRAY[1..10] OF TEST_STRUCT; ArrayOfStruct:...
I think I understand what you're trying to do. It caught my attention because I've done something similar. I set up a test like this: TYPE TEST_STRUCT_1 : STRUCT First: STRING:= 'First'; Second: STRING:= 'Second'; END_STRUCT END_TYPE TYPE TEST_STRUCT_2 : STRUCT Third: STRING:= 'Third'; Fourth: STRING:= 'Fourth'; END_STRUCT END_TYPE TYPE TEST_STRUCT : STRUCT Test1: TEST_STRUCT_1; Test2: TEST_STRUCT_2; END_STRUCT END_TYPE PROGRAM Test_PRG VAR TestStruct: ARRAY[1..10] OF TEST_STRUCT; ArrayOfStruct:...
I think I understand what you're trying to do. It caught my attention because I've done something similar. I set up a test like this: TYPE TEST_STRUCT_1 : STRUCT First: STRING:= 'First'; Second: STRING:= 'Second'; END_STRUCT END_TYPE TYPE TEST_STRUCT_2 : STRUCT Third: STRING:= 'Third'; Fourth: STRING:= 'Fourth'; END_STRUCT END_TYPE TYPE TEST_STRUCT : STRUCT Test1: TEST_STRUCT_1; Test2: TEST_STRUCT_2; END_STRUCT END_TYPE PROGRAM Test_PRG VAR TestStruct: ARRAY[1..10] OF TEST_STRUCT; ArrayOfStruct:...
I do not think this will work, because JSON_TO_STRUCT is expecting the JSONVars input to consist of only variables of JSONVAR type. It doesn't matter if they are a STRUCT or an ARRAY on the outside, but within the function block they are all addressed as an ARRAY OF JSONVAR. The more I look at it, I think it would require a substantial rewrite. Basically everything would have to be changed to WSTRING internally. Which might be something to look at in the future, but it's not a quick fix.
Thinking about it a bit more, there's probably some changes that would need to be made to the JSONVAR function block as well. Line 110 of JSON_TO_STRUCT is where the value from the JSON string is written to the local variable. It uses the JSONVAR.AsString method. It takes a STRING type, which in turn uses the STRING_TO_JSONVALUE function to guess at what type the value is. I think all of those points would also have to be changed.
Thinking about it a bit more, there's probably some changes that would need to be made to the JSONVAR function block as well. Like 110 of JSON_TO_STRUCT is where the value from the JSON string is written to the local variable. It uses the JSONVAR.AsString method. It takes a STRING type, which in turn uses the STRING_TO_JSONVALUE function to guess at what type the value is. I think all of those points would also have to be changed.
Yes. You should be able to open the .library file and make the changes and then save it to your own library repository
For future reference, see the discussion here: https://forge.codesys.com/forge/talk/Engineering/thread/c7d3ad3156/
Sorry, I just realize that I only implemented the ASCII enumeration in version 1.0.0.12, which I haven't released yet. In the version 1.0.0.11, the JSON strings are referred to as: {attribute 'displaymode':='hex'}JSONString: POINTER TO ARRAY[1..GPL_JSON.MAX_JSON_STRING] OF BYTE; //pointer to JSON string which might mean you just have to change the BYTE to a WORD
Hi I created the PRO_JSON library. It's designed to use STRING types, but the functions refer to the strings like this: JSONString: POINTER TO ARRAY[1..GPL_JSON.MAX_JSON_STRING] OF ASCII; where ASCII is just an enumeration of all ASCII characters (type BYTE). the code uses the array index, not pointers, to iterate over all the characters. So, I haven't tried this out, but it might be as simple as changing the ASCII enumeration to WORD type. That would change the array elements to 16 bit, and since...
Use the StringUtils library. It uses pointers to the string, so you can have any length. https://help.codesys.com/webapp/idx-StringUtils-lib;product=StringUtils;version=3.5.15.0
Use the StringUtils library. It uses pointers to the string, so you can have any length of string. https://help.codesys.com/webapp/idx-StringUtils-lib;product=StringUtils;version=3.5.15.0
I saw something in the Visu Value Change example the other day that might help you. https://forge.codesys.com/prj/codesys-example/visu-value-chan/home/Home/ Look in the FB_ValueChangedListener.ValueChanged method. I haven't tried it yet.
I'm not clear on exactly what you're trying to do here, but creating a reference to the interface is not necessary. Just make your property of type IEngineeringValue, and in your property do LiveValue:= _liveValue the interface acts kind of a like a reference already
Here's an example of one of the structures I was using with Open Weather Map: TYPE OWM_WEATHER : STRUCT id: JSONVAR; main: JSONVAR; description: JSONVAR; icon: JSONVAR; END_STRUCT END_TYPE Weather: OWM_WEATHER; You'll have to create structures and arrays that match the expected result from whichever API you're using. Order doesn't matter, but the structure does. (But parsing will be faster if the order matches as closely as possible). So then, for example, if I want to get the description, I could...
well, for what it's worth, the JSON library uses STRING variables as well, but feel free to modify it. The main conversion function blocks uses a pointer to the string: JSONString: POINTER TO ARRAY[1..GPL_JSON.MAX_JSON_STRING] OF BYTE; It might be as easy as changing the BYTE to a WORD, because after that it uses array indexes, not pointer math. But I haven't tested that.
well, for what it's worth, the JSON library uses STRING variables as well, but feel free to modify it. The main conversion function blocks uses a pointer to the string: JSONString: POINTER TO ARRAY[1..GPL_JSON.MAX_JSON_STRING] OF BYTE; It might be as easy as changing the BYTE to a WORD, because after that it uses array indexes, not pointers. But I haven't tested that.
Take a look at this library: https://forge.codesys.com/lib/pro-json/home/Home/ I created it and did most of the testing with open weather map, which looks like what you're using as well.
Is there a maximum number of points that can be plotted on an XY chart element, or is that determined by the controller hardware limits?
I tried creating a test project, but I wasn't able to reproduce the issue in a simplified environment until today. It looks like the issue comes up whenever "Support client animations and overlay of native elements" is checked in the Visualization Manager. I could disable that setting, but the only reason I've been using it is to support animated .gif files, which don't seem to work without it.
What about this? TYPE TIMESTAMP_UNION : UNION As2RealS: TIMESTAMPASREAL; AsTimeStamp: TIMESTAMP; AsHex: TIMESTAMPASHEX; END_UNION END_TYPE TYPE TIMESTAMPASREAL : STRUCT Real1: REAL; Real2: REAL; END_STRUCT END_TYPE TYPE TIMESTAMPASHEX : STRUCT {attribute 'displaymode':='hex'}Byte1: BYTE; {attribute 'displaymode':='hex'}Byte2: BYTE; {attribute 'displaymode':='hex'}Byte3: BYTE; {attribute 'displaymode':='hex'}Byte4: BYTE; {attribute 'displaymode':='hex'}Byte5: BYTE; {attribute 'displaymode':='hex'}Byte6:...
fixed it
Depending on what environment you're using, you might be able to find a LIM function in one of the libraries (NOTE: not the same as the LIMIT operator). If not, it's easy to make one: FUNCTION LIM : BOOL VAR_INPUT i_Test: REAL; //value to test i_Upper: REAL; //upper limit i_Lower: REAL; //lower limit END_VAR LIM:= (i_Test >= i_Lower) AND (i_Test <= i_Upper); //in your program Start_Clapping:= LIM(Incoming_Real, Add_On + 0.8, Add_On - 0.8);
Depending on what environment you're using, you might be able to find a LIM function in one of the libraries (NOTE: not the same as the LIMIT operator). If not, it's easy to make one: FUNCTION LIM : BOOL VAR_INPUT i_Test: REAL; //value to test i_Upper: REAL; //upper limit i_Lower: REAL; //lower limit END_VAR LIM:= (i_Test >= i_Lower) AND (i_Test <= i_Lower); //in your program Start_Clapping:= LIM(Incoming_Real, Add_On + 0.8, Add_On - 0.8);
Depending on what environment you're using, you might be able to find a LIM function in one of the libraries (NOTE: not the same as the LIMIT operator). If not, it's easy to make one: FUNCTION LIM : BOOL VAR_INPUT i_Test: REAL; //value to test i_Diff: REAL; //differential END_VAR LIM:= (i_Test >= (i_Test - i_Diff)) AND (i_Test <= (i_Test - i_Diff)); //in your program Start_Clapping:= LIM(Incoming_Real, 0.8);
I'm doing some testing with the text editor example found here: https://forge.codesys.com/prj/codesys-example/text-editor-exa/home/Home/ It works fine until I enable the setting "Activate property handling in all element properties" in the Project Settings. Then it crashes with the following message in the log: "Get-Property will crash because it did not evaluate to a valid getter. Is there an inbetween null value in nested properties? See screenshot with Log and Call Stack Is there any way around...
Eduardo Try the latest version, I just updated it on the forge site as well. https://www.dropbox.com/s/ql4b4ehxghvrsvc/PRO_JSON%201.0.0.11.library?dl=0 There's some more examples in this version as well, maybe that will help, otherwise my email is in the library, you can send me an example of the issue you're having Tim
Home
what if you did this? FUNCTION SQ VAR_INPUT In: ANY; Out: ANY; END_VAR since the ANY type gives you the size, type, and a pointer to the value, you can write your result to the pointer at Out.pValue. Create a bunch of pointers to whatever data types you want to use, for example: VAR pRealResult: POINTER TO REAL; END_VAR pRealResult:= Out.pValue; //write your REAL answer to pRealResult^
Well, I apologize then, that certainly wasn't my intention.
"If you are not happy with my answers, I will let others answer them then..." seems a little aggressive...I'm just trying to understand what you mean. Wouldn't hurt if there was a list of known issues and workarounds somewhere. The people in the field installing this stuff waste a lot of time trying to figure stuff like this out.
OK, except for global variables I guess. Here's a workaround. Declare the array in a GVL with the same name as the variable you want to use in the interface. Do the "Multiply Visu Element" command. Then when you're done, do a Find/Replace and replace "GVL." with nothing.
So, when you say it's not possible to use the interface variables, is that just another way of saying the feature doesn't work at all? Because that seems to me like the only type of variables in a visualization.
I'm trying to use the "Multiply Visu Element" command https://help.codesys.com/api-content/2/core_visualization/3.5.16.0/en/_visu_create_similar_elements_in_many_cases/ Seems like it should be pretty straightforward--configure an element like the attached screenshot, select it, and go to "Visualization/Multiply Visu Element". But I get an error message "command can only be executed if the visu element has at least one configuration entry using an array variable and the array variable uses the index...
Download package Download package Every now and then I get a graphic file that I just can't get to display with a transparent background. In the design, I've selected the "transparent" box, and a transparent colour, and it displays transparent in the editor. But at run time, it's not actually transparent, it displays the colour. Some files work, some don't. They're all .png format. Is there something I'm missing? Two files attached, one from design, and one at runtime.
Every now and then I get a graphic file that I just can't get to display with a transparent background. In the design, I've selected the "transparent" box, and a transparent colour, and it displays transparent in the editor. But at run time, it's not actually transparent, it displays the colour. Some files work, some don't. They're all .png format. Is there something I'm missing? Two files attached, one from design, and one at runtime.
Thanks, that points me in the right direction. For some reason, that System text list wasn't included in that project. I copied it from another one and it's displaying properly now.
I have a date and time picker configured with this as a Format string: %t[MMM d, yyyy] At runtime, the display looks like the attached screenshot. Why would the format string "MMM" come out as May_3Letter ? UPDATE: This only happens with a date in May. All the other months come out correctly. Is there a text table somewhere that's misconfigured?
I have a date and time picker configured with this as a Format string: %t[MMM d, yyyy] At runtime, the display looks like the attached screenshot. Why would the format string "MMM" come out as May_3Letter ?
Is there any way to get rid of some of the extra confirmation dialog boxes? I recently upgraded from SP12 to SP16, and with the older version I could, for example, write a value by simply pressing Ctrl+F7. Now, it's Ctrl+F7 plus a dialog box "Do you really want to perform the operation "Write Values"?" Well, yes actually, I do. That's why I pressed Ctrl+F7, which is not a key combination I'm going to hit accidentally. Not sure if it's a change in the software or a setting somewhere. thanks
This is the reply I got from Codesys tech support: "There's a bug in SP16 related to the visualization profile. Unfortunately the fix will not come until SP18 (next year)." The workaround for now is to do a "Build/Rebuild", sometimes multiple times, but it eventually compiles and downloads
FYI for anyone else that comes across it, this is a bug in SP16 that is supposed to be fixed with SP18, sometime next year.
I'm getting an error: "C0077: Unknown type" in my projects since upgrading to SP16. Older projects (SP12) work fine. The basic setup in the attached test project is this: There is one function block and three visualizations. The function block contains nothing. The visus contain nothing. I've removed all the code from the test program in order to reduce it to its most simple form. The first visu is a button, which takes the function block as an VAR_IN_OUT The second visu is a dialog box, which also...
Yes, then I would create a library that contains the ENUM as well as the function block. Then you can reuse them in whatever project you install the library into.
Why don't you just create an ENUM, call it ASCII or whatever TYPE ASCII { CHR_STX:= 16#02; CHR_ETX:= 16#03; CHR_ACK:= 16#06; CHR_NAK:= 16#15; } BYTE END_TYPE then just make your method input of type ASCII VAR_INPUT In: ASCII; END_VAR Then call your method like this: myBlock.SendChar(ASCII.CHR_STX); same thing with the error code ENUM. Just create the ENUM and you can use it anywhere. VAR ErrorCode: enumErrorCode; END_VAR
When did VisuUtils become available? I'm using Schneider Machine Expert, which is based on Codesys 3.5.12, but I don't have that library.
Is it possible to use functions from the VisuElems library within my own library? My idea was to create some functions to open/close dialogs, change the displayed visu, get information from clients, etc, and put them all in my own library so I don't have to copy and paste code all the time. But I'm having issues with using the functions from the library. They work when copied into a project, but not from the library. Some functions crash, some just don't work. Any issues with this concept? thank...
I'm doing this by creating a separate X axis array in the visualization that's nothing more than an array of numbers counting up within the visu that's displaying the XY Chart: VAR XAxisData: ARRAY[1..1440] OF REAL:= INIT_XAXIS(); END_VAR where the INIT_XAXIS function is simply: FOR i:= 1 TO 1440 DO //initialize X Axis: 1 to 1440 INIT_XAXIS[i]:= INT_TO_REAL(i); END_FOR the XY chart curve Data X variable points to XAxisData then I hide all the X axis numbers, ruler, ets, and create the timestamps...
I'm doing this by creating a separate X axis array in the visualization that's nothing more than an array of numbers counting up within the visu that's displaying the XY Chart: VAR XAxisData: ARRAY[1..1440] OF REAL:= INIT_XAXIS(); END_VAR where the INIT_XAXIS function is simply: FOR i:= 1 TO 1440 DO //initialize X Axis: 1 to 1440 INIT_XAXIS[i]:= INT_TO_REAL(i); END_FOR the XY chart curve Data X variable points to XAxisData then I hide all the X axis numbers, ruler, ets, and create the timestamps...
I'm doing this by creating a separate X axis array in the visualization that's nothing more than an array of numbers counting up within the visu that's displaying the XY Chart: VAR XAxisData: ARRAY[1..1440] OF REAL:= INIT_XAXIS(); END_VAR where the INIT_XAXIS function is simply: FOR i:= 1 TO 1440 DO //initialize X Axis: 1 to 1440 INIT_XAXIS[i]:= INT_TO_REAL(i); END_FOR then I hide all the X axis numbers, ruler, ets, and create the timestamps manually using text fields and some functions to get the...
I have several text boxes configured with this text formatting string for a DT variable: %t[MMM d, yyyy HH:mm:ss]. They all display "mar 10, 2021 13:21:21" Any reason why the month is all lower case? I'd like it to show "Mar"...
Any ideas why an XY chart would display like the attached screenshot? The curve variable is an ARRAY[1..1440] OF REAL, at the time of the screenshot only a few of the variables had values, between 15.7 and 21.6, and the rest were 0. Autoscale on the y axis is turned on, so I would expect to see the scale between 0 and 21.6. Instead i'm getting these massive numbers on the scale.
it seems to have something to do with the use of reference variables. I have the XY chart in a frame, the interface of which looks like this: VAR_IN_OUT ChartData: ARRAY[1..1440] OF REAL; END_VAR Change it to this, and it works: VAR_INPUT ChartData: ARRAY[1..1440] OF REAL; END_VAR
Any ideas why an XY chart would display like the attached screenshot? The curve variable is an ARRAY[1..1440] OF REAL, at the time of the screenshot only a few of the variables had values, between 15.7 and 21.6, and the rest were 0. Autoscale on the y axis is turned on, so I would expect to see the scale between 15.7 and 21.6. Instead i'm getting these massive numbers on the scale.
Home
I used to do it the way you've described. I now do it this way, which I've found easier. FUNCTION BLOCK TEST_FB VAR PERSISTENT Setpoints: SETPOINT_STRUCT; //all persistent variables END_VAR Then, within the PersistentVars variable list, go to "Declarations/Add all instance paths". The paths of all your persistent variables will be automatically created. https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_cmd_add_all_instance_paths/ You asked about the whole function block being added...
I used to do it the way you've described. I now do it this way, which I've found easier. FUNCTION BLOCK TEST_FB VAR PERSISTENT Setpoints: SETPOINT_STRUCT; //all persistent variables END_VAR Then, within the PersistentVars variable list, go to "Declarations/Add all instance paths". The paths of all your persistent variables will be automatically created. https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_cmd_add_all_instance_paths/
I've attached an example. It displays somewhat different behaviour in that none of the rows are selectable at all when either one of the frames is configured "fixed and scrollable". I'm using Schneider Machine Expert though, so I don't know if this will be openable in plain Codesys.
I managed to isolate the problem. There are two tables displayed on the same page, both embedded into frames. If either one of the frames is configured with a scaling type of "Fixed and Scrollable", both frames start to display the strange behaviour. That's easily fixed, because the table element has its own scroll bars, so I can set the scaling type to something else.
I have a table element that's displaying some strange behaviour. The table is displaying an ARRAY[1..250] OF STRING(40). It displays the values properly as long as they don't change. Any time I change a value, only the three or four values around the changed one will display. The rest of the table turns into a blank grey area. See attached pictures. The same behaviour is displayed whenever I try to select a row in the table. Is there a limit on the number of elements I can display, or the size of...
What about this? FUNCTION_BLOCK BASE VAR_STAT Shared: INT; END_VAR FUNCTION_BLOCK FB_1 EXTENDS BASE FUNCTION_BLOCK FB_2 EXTENDS BASE
What about this? FUNCTION_BLOCK BASE VAR_STAT Shared: INT; END_VAR FUNCTION_BLOCK FB_1 EXTENDS BASE FUNCTION_BLOCK FB_2 EXTENDS BASE
One further question comes up. I've been removing the text list support from the enumerations and creating separate text lists. This seems to be working better. Is there a difference between the two methods as far as memory use and allocation?
Thank you. I agree with the other comments there that it would be nice to see some documentation for these sort of features.
I would like to open a dialog box at a position relative to the calling element, in this case a button. Looking through here: https://help.codesys.com/webapp/_visu_dlg_input_configuration;product=core_visualization;version=3.5.15.0 under the input action "Write a Variable", it says "You can use the placeholders ElementRectangle.ptTopLeft.iX and .iY ElementRectangle.ptBottomRight.iY. It is replaced at runtime by the coordinates of the calling element". Does this apply to the input action "Open Dialog"...
Thanks for the input. I ended up configuring the text field as %s, and referencing properties of type STRING in the function block. The visualization then calls the get/set functions of the property, which do the conversion and error checking for the input, etc.
But I still want the error checking (which is present in the date and time picker) in case someone enters "99:88" or something
Basically, yes. It comes out of a service call I had, where the operator was trying to enter "11:55" into a text field configured as %t[HH:mm]. It wouldn't work because he had to enter it as "TOD#11:55". Which is not something the average operator is going to know, he just wants to enter a time
Yeah it just seems odd that you can configure it with a TOD variable, and then the date picker does nothing. Basically I'm trying to configure a time of day input field. Configuring it like %t[HH:mm] works except then the operator has to enter 'TOD#11:55', which is confusing. I could use a string input (%s), but then I have to convert to TOD if/when the input is valid, and the visualization can't convert variables on the input side, only in the "Text Variable" field. I guess I just figured there...
Is there any way to configure a date and time picker to only be able to select the time of day, not the date as well? I have it configured with a TOD variable and a format string of HH:mm, and everything works fine, I basically just don't want to see the dropdown arrow with the date selector, which doesn't actually do anything when configured with a TOD variable.
OK, thanks for the information, it has helped me to narrow down the problem. I had a library with quite a few enumerations, all of which had text list support. If I remove the text list support from some of them, things start to work. Then I added another library, and it stopped working again, until I removed more text list support. Maybe I was hitting the limit of available memory for text lists, which is why sometimes one library would appear to be causing the issue, another times, a different...
OK, thanks for the information, it has helped me to narrow down the problem. I had a library with quite a few enumerations, all of which had text list support. If I remove the text list support from some of them, things start to work. Then I added another library, and it stopped working again, until I removed more text list support. Maybe I was hitting the limit of available memory for text lists, which is why sometimes one library would appear to be causing the issue, another times, a different...
OK, thanks for the information, it has helped me to narrow down the problem. I had a library with quite a few enumerations, all of which had text list support. If I remove the text list support from some of them, things start to work. Then I added another library, and it stopped working again, until I removed more text list support. Maybe I was hitting the limit of available memory for text lists, which is why sometimes one library would appear to be causing the issue, another times, a different...
I'm not sure if that makes sense. I've played around with the size of memory for visu in the Visualization Manager, increasing it all the way to 3 MB, and I can see the Device Memory Info reflect that (attached), but I get the same error, that it can't allocate 60KB. Or is there another memory area that being referenced here?
I finally have some error messages in the log. I'll get "Allocating a new chunk of memory (60000 bytes) for the dynamic texts failed" over 300 times in the log after a download/start. References component CmpDynamicText. I can't find any information on this error, does anyone know what it means?
I finally have some error messages in the log. I'll get "Allocating a new chunk of memory (60000 bytes) for the dynamic texts failed" over 300 times in the log. References component CmpDynamicText. I can't find any information on this error, does anyone know what it means?
I finally have some error messages in the log. I'll get "Allocating a new chunk of memory (60000 bytes) for the dynamic texts failed" over 300 times in the log. References component CmpDynamicText. I can't find any information on this error, does anyone know what it means? [-img src=allocating new chunk of memory.png width=50%: missing =-]
I have a strange problem with one of my libraries. Including the library in an application causes visualizations to stop working. This happen even if the library is only included in the library manager, and none of the function blocks are actually used in the program. I get a message "The online visualization is waiting for a connection. Please start the application", and applies to web visualizations as well. I can see by monitoring the cycle times in VISU_TASK that it's not actually doing anything...