CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Fri Nov 22, 2019 1:57 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 17, 2019 3:07 pm 
Offline

Joined: Wed Jan 16, 2019 7:18 pm
Posts: 11
Hi,

I am new to Visualization. I am using an OEM IDE, based on CodeSys 3.5.

I am trying to use a Visualization Table to read and write data to a single row of 16 row array. The row to be displayed will be selected by setting a global variable, which will be used as the index. [NOTE: It's not possible to use a visualization local variable as an index to an array, the compiler throws an error]

In the table properties, the 'Data array' is defined as 'Program_POU.arrayName[GVL_Var.arrayIndex]'

For the column properties, I have selected 'Use template' and under the 'Template' -> 'Inputconfiguration', I have set 'OnMouseClick' to 'Write a Variable', and under 'Choose variable to edit', I have selected 'Use text output variable'.

In the visualization, the table displays the data just fine. As I vary the 'arrayIndex' value, the correct row of the data array is displayed.

However, I can't write to the data array. I click on the array cell, and the cell opens and allows me to type in the new value. However, when I press enter, no data is written to the array.

I have tested this with a hard coded index, and it works just fine. However, it would be very inefficient for me to have to create 16 unique instances of this visualization, rather than create one and use a variable index.

Is what I am doing supposed to be supported?

_________________
Tim Manning


Top
   
PostPosted: Fri Jan 18, 2019 3:33 pm 
Offline

Joined: Wed Jan 16, 2019 7:18 pm
Posts: 11
I have tested this further and the issue seems to be with writing to an array of structures. If I write to an array of primitives (e.g., an array of INTs or REALs) everything works fine. However, writing to an array of structures, I can't write if the array index is a variable. I can write to an array of structures if the array index is fixed.

See my test cases and results below.

Am I doing something wrong, or is this a bug?

I have tested this as follows:

Test 1
Type of Element = Text field
Column = 'Use Template' -> 'InputConfiguration' -> 'On mouse click' -> 'Write variable'

Case 1
Text Variable = 'Program_POU.arrayName[GVL_Var.arrayIndex]' -

Result - Read - SUCCESS
Write - SUCCESS

Case 2
Text Variable = 'Program_POU.structName[GVL_Var.arrayIndex].structElement'

Result - Read - SUCCESS
Write - FAIL

Case 3
Text Variable = 'Program_POU.structName[1].structElement'

Result - Read - SUCCESS
Write - SUCCESS

Test 2
Type of Element = Table

Case 1
Data array = 'Program_POU.arrayName[GVL_Var.arrayIndex]'

Column = 'Use Template'
Text Variable = 'Program_POU.arrayName[GVL_Var.arrayIndex]'
'InputConfiguration' -> 'On mouse click' -> 'Write variable'

Result - Read - SUCCESS
Write - SUCCESS

Case 2
Data array = 'Program_POU.structName[GVL_Var.arrayIndex]'

Column = 'Use Template'
Text Variable = 'Program_POU.structName[GVL_Var.arrayIndex].structElement'
'InputConfiguration' -> 'On mouse click' -> 'Write variable'

Result - Read - SUCCESS
Write - FAIL

Case 3
Data array = 'Program_POU.structName[1]'

Column = 'Use Template'
Text Variable = 'Program_POU.structName[1].structElement'
'InputConfiguration' -> 'On mouse click' -> 'Write variable'

Result - Read - SUCCESS
Write - SUCCESS

Test 3
Type of Element = Radio Button

Case 1
Variable = 'Program_POU.arrayName[GVL_Var.arrayIndex]'

Result - Read - SUCCESS
Write - SUCCESS

Case 2
Variable = 'Program_POU.structName[GVL_Var.arrayIndex].structElement'

Result - Read - SUCCESS
Write - FAIL

Case 3
Variable = 'Program_POU.structName[1].structElement'

Result - Read - SUCCESS
Write - SUCCESS

_________________
Tim Manning


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited