Red Lion Switch Statement

Hey everyone,


I am sending an email from a red lion. If I just use 1 of the case statements without the full switch statement, the email works fine. But when I use the full switch statement I am not getting an email. Can anyone provide some insight on what might be wrong with my switch statement?


JMJJyj4.png
 
I think you need a break statement after each case in order to keep it from falling through to the next case. See the example in the Crimson Help Software Guide.

But if your CavityNumber tag is an integer and is equal to one of the cases, it should have triggered the email.
 
You should have a 'break' instruction at the end of each case, it stops the Switch after the first right one is found, otherwise all cases after the found one will be executed.

You should add a 'default' case to catch any value of CavityNumber that doesn't match your list. It can help in fault finding if the Switch Case isn't working as expected. Also you can debug what is going on by adding bool flags to see where the program gets to.

A web search of 'programming in C' followed by your question tends to get good results, like this 'programming in C switch case':
https://beginnersbook.com/2014/01/switch-case-statements-in-c/
 

Similar Topics

Hi everyone, I need to measure the current in my experimental setup and the supplier provided me with a GMINV8 and GMINI8 from Red Lion. My plan...
0
Replies
189
Views
Hello Guys, I am trynna start a project of standardization, firstly I will work on migrating an hmi that is Red Lion to Allen-Bradley Panel View...
9
Replies
550
Views
Hi All, Has anyone noticed a sporadic memory leak on Red Lion (HMS Networks) FlexEdge DA50 and DA70 PLCs? I have a small number of these running...
19
Replies
1,081
Views
I am having an issue with bits sticking in the PLC from the HMI. Pressing a momentary button and releasing may leave the bit on in the PLC. I have...
7
Replies
702
Views
Hey guys I am rather new to dealing with Red Lions, and I am currently experiencing issues with one I recently set up. In Crimson 3.2, In my...
2
Replies
545
Views
Top