Hi guys, i have some problems with sharing some variables from an FB with HMI, the behavior is very strange.. i cant toggle a variable, the variable on button push is set but after it wont reset, i suppose a packing problem...
VAR
xRun:BOOL; //Run command
xRunning:BOOL; //Drive is running
xFault:BOOL; //Drive fault
xComFault:BOOL; //Communication fault
iStatus:INT; //DriveStatus
iFreq:INT; //Drive frequency
xReset_:BOOL; //Reset faults
arrRead: ARRAY[0..1] OF WORD; //Read buffer
arrWrite:ARRAY[0..2] OF WORD; //Write buffer
END_VAR
VAR_GLOBAL
Conveyor:ARRAY[0..DrivesCount] OF DeltaDriveFB; //Conveyors
END_VAR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With the amount of information you are giving is difficult to bullseye the answer...
Anyway a few thoughts:
In the switch settings you can add handlers for the touch, while touch and release operations.
You could keep the signal On only for a while using the "Momentary ON" at when touch.
you could set the variable at "When touch" and reset it at "When release".
You could simply toggle the variable at "When touch".
What is happening exactly? how have you shared the variables? do you have both equipment connected (HMI/PLC) or you are simulating any of them? which variable is giving you problems and could you send some screenshots?
Good luck!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No errors on the screen?
Do you have any interlock active? (advanced tab)
Does it happen with other variables too?
I've seen that some times you need to clean all and update the links in order to make the communication work, but I don't know if this is the case here...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
it wont toggle even with script
int job;
job = _SoM.PLC.Application.GVL.Conveyor[0].xRun.getIntValue();
if(_SoM.PLC.Application.GVL.Conveyor[0].xRun.isDataQualityGood()){
if(job==0){
_SoM.PLC.Application.GVL.Conveyor[0].xRun.write(1);
}
else
{
_SoM.PLC.Application.GVL.Conveyor[0].xRun.write(0);
}
}
just set
practically this variable is not updated by hmi, other variables are, just checked it is always false in hmi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Update the variable link. Yours is a structure, therefore a user defined variable... check if you have the right structure in the HMI software (I mean the most updated one).
Try to change that variable for another type or even putting another bit before it in your structure. I don't know exactly how the redirection is done between the SOM and Vijeo, but in other software mostly in fieldbus communications you can see how the mapping is done different in both devices and that this could lead to this kind of strange thing.
I'm afraid I can't help you much more than that...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Juan it seems that a dummy variable solved somehow the problem. But I'm confused about the method. Think I shoud write to schneider support maybe a software bug.
BR Alex )
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've seen plenty of badly implemented things in SoMM and buying the displays from ProFace and then integrating them into their product portfolio could be the reason for those hiccups.
When you communicate different devices sometimes the amount of bits that are used for the same variable kind change or, even worse, the different devices have different needs regarding how to store data and in some cases you need complete words even the variable is smaller... even you can find a combination of both problems...
anyway, then different approaches can be used:
sorting variables.
using dummy variables to fit better the variable you want.
using different types to ensure you are getting the desired result.
Try to send them a small demo and the steps to reproduce the error. I don't think you will get any solution soon, but at least you know how to avoid the issue in future occasions.
I've seen this to happen in communications between different product brands, never before in the same brand, but there is always a first time for everything.
You are welcome!
And good luck.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Joan Murt hat geschrieben:
When you communicate different devices sometimes the amount of bits that are used for the same variable kind change or, even worse, the different devices have different needs regarding how to store data and in some cases you need complete words even the variable is smaller... even you can find a combination of both problems...
Joan is correct. You can not share function blocks via the symbol list. The reason is the way CoDeSys/SoMachine byte packs the variables including bool. This means CoDeSys really stores a bool as a byte. This is what cause some variables not to work in the HMI. Also note you will have the same problem if you do not share all the variables within a structure. If you do not share all variables inside the structure, Vijeo's communication driver will not correctly transfer all the required data that represent the variable. There was PCR request to fix the problem but developers but a warning in the release notes instead .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys, i have some problems with sharing some variables from an FB with HMI, the behavior is very strange.. i cant toggle a variable, the variable on button push is set but after it wont reset, i suppose a packing problem...
VAR
xRun:BOOL; //Run command
xRunning:BOOL; //Drive is running
xFault:BOOL; //Drive fault
xComFault:BOOL; //Communication fault
iStatus:INT; //DriveStatus
iFreq:INT; //Drive frequency
xReset_:BOOL; //Reset faults
arrRead: ARRAY[0..1] OF WORD; //Read buffer
arrWrite:ARRAY[0..2] OF WORD; //Write buffer
END_VAR
VAR_GLOBAL
Conveyor:ARRAY[0..DrivesCount] OF DeltaDriveFB; //Conveyors
END_VAR
With the amount of information you are giving is difficult to bullseye the answer...
Anyway a few thoughts:
What is happening exactly? how have you shared the variables? do you have both equipment connected (HMI/PLC) or you are simulating any of them? which variable is giving you problems and could you send some screenshots?
Good luck!
Hi Juan thanks for answer, here some screens
I forgot to say i use so machine 4.1 & vijeo designer 6.2
No errors on the screen?
Do you have any interlock active? (advanced tab)
Does it happen with other variables too?
I've seen that some times you need to clean all and update the links in order to make the communication work, but I don't know if this is the case here...
No interlocks, in PLC code also.. some variables are not read it depends how many i check in symbol configuration.... very strange behavior!!
it wont toggle even with script
int job;
job = _SoM.PLC.Application.GVL.Conveyor[0].xRun.getIntValue();
if(_SoM.PLC.Application.GVL.Conveyor[0].xRun.isDataQualityGood()){
if(job==0){
_SoM.PLC.Application.GVL.Conveyor[0].xRun.write(1);
}
else
{
_SoM.PLC.Application.GVL.Conveyor[0].xRun.write(0);
}
}
just set
practically this variable is not updated by hmi, other variables are, just checked it is always false in hmi
Two things to try:
I'm afraid I can't help you much more than that...
Thanks Juan it seems that a dummy variable solved somehow the problem. But I'm confused about the method. Think I shoud write to schneider support maybe a software bug.
BR Alex )
I've seen plenty of badly implemented things in SoMM and buying the displays from ProFace and then integrating them into their product portfolio could be the reason for those hiccups.
When you communicate different devices sometimes the amount of bits that are used for the same variable kind change or, even worse, the different devices have different needs regarding how to store data and in some cases you need complete words even the variable is smaller... even you can find a combination of both problems...
anyway, then different approaches can be used:
Try to send them a small demo and the steps to reproduce the error. I don't think you will get any solution soon, but at least you know how to avoid the issue in future occasions.
I've seen this to happen in communications between different product brands, never before in the same brand, but there is always a first time for everything.
You are welcome!
And good luck.
Joan is correct. You can not share function blocks via the symbol list. The reason is the way CoDeSys/SoMachine byte packs the variables including bool. This means CoDeSys really stores a bool as a byte. This is what cause some variables not to work in the HMI. Also note you will have the same problem if you do not share all the variables within a structure. If you do not share all variables inside the structure, Vijeo's communication driver will not correctly transfer all the required data that represent the variable. There was PCR request to fix the problem but developers but a warning in the release notes instead .