Greetings! I am currently facing an issue with the TimeDateDisplay feature in FactoryTalk ME, as the PanelView is experiencing random time loss on Window CE. To address this, I have opted to utilize the Time and Date data stored within the PLC5 (S files) and leverage the RsLogix 5000 Clock Update Tool, which has proven to be effective. However, I have encountered a challenge with the data format, as the Month and day are represented as integers (e.g. "8" for August). How can I set up the expression editor to display the month as its corresponding name (e.g. "August") in the string display object? Please refer to the attached screenshot. I intend to create a nested if statement for all 12 months and days of the week to resolve this issue.
Have you noticed that the PanelView is experiencing issues with its clock, such as resetting to incorrect dates or jumping ahead by a century? I'm interested in learning more about what you mean by the system time being "lost." The PanelView Plus relies on a global connection for syncing its time with the controller, but this feature is often misused. The programming language used for PanelView Plus expressions lacks certain features like "return" statements or semicolons, which can lead to errors. For example, an IF statement needs to have both a THEN and an ELSE clause to handle the True and False outcomes. One common mistake is not providing a value for the ELSE clause, resulting in errors like missing values. Instead of using a CASE...OF instruction, FactoryTalk View Machine Edition does not support VBA or VBScript for more advanced programming.
Ken Roach inquired about the PanelView losing its system time, whether it resets to earlier years or jumps ahead. The PanelView Plus relies on a global connection to sync time from the controller, but it is often misused. The PV+ expressions lack standard syntax rules, such as "return" or semicolons. An IF statement needs both THEN and ELSE clauses to define its outcomes accurately. The absence of a value, even a null string, can lead to errors in code execution. Using a CASE...OF instruction would be beneficial, but FTView ME lacks support for VBA or VBScript. Thank you, Ken, for your input. This particular PanelView is set to 2023, with the global connection transmitting remote time to a file location in PLC5 for computing. Instead of relying on the global connection, using the S files time and date updated by the RS Logix 5000 clock tool could be a more efficient approach.
Thank you for providing additional detail and context! I would like to address the issue of misusing PV+ global connections, which occurs when both the PV → PLC time register writes and the PLC → PV time register reads (along with the Update trigger) are inadvertently used simultaneously. This can result in introducing a delay into the clock, leading to what appears to be significant drift. It is important to remember that while wearing one watch allows you to know the time, wearing two watches can create confusion and uncertainty.
Having two Rolex watches is never a problem!
The solution you're considering, namely creating a nested if-statement for all 12 months and days of the week, will certainly work, though it might be a bit unwieldy. An alternative approach might be to create an index-based array of string values for the months and days, respectively. You would then use the integer values you're currently dealing with as indices to pull the correct string value from each array. This approach would provide you with the same result, but with considerably cleaner and more maintainable code. Remember that the index starts from 0, so you may need to make small adjustments accordingly, like subtracting 1 from your integer values.
Hello! It sounds like you're on the right track with using a nested IF statement to convert the integer month value to its corresponding name. However, instead of manually creating a separate conditional branch for each month (which can be a bit tedious), you may want to consider using an array of strings for the month names and index it using the integer month value. This could be a far more efficient way to implement this conversion. To achieve this, you could define an array where each index corresponds to a month (with an offset, since array indexing typically begins at zero), with its content being the month's name. For example, months[8] would be "August". Be aware of the zero-based index while implementing this. Hope this helps!
Hey there, it's definitely possible to resolve your issue. Instead of writing the IF statements manually, which can be quite tedious and error-prone, you may want to consider using the SELECT expression in FactoryTalk ME instead. It can reduce your code significantly. For instance, to convert your integer month to a string, the expression would be something like SELECT(MonthVariable, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"). The expression essentially matches the numeric value of MonthVariable to the corresponding month string. I hope this helps!
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: Answer: The PanelView is experiencing random time loss on Window CE.
Answer: Answer: The user is utilizing the Time and Date data stored within the PLC5 (S files) and leveraging the RsLogix 5000 Clock Update Tool.
Answer: Answer: The Month and day are represented as integers (e.g. "8" for August) instead of their corresponding names.
Answer: Answer: The user intends to create a nested if statement for all 12 months and days of the week to resolve this issue.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.