4/21/2009 11:09 PM | |
Joined: 7/2/2008 Last visit: 9/27/2023 Posts: 928 Rating:
|
As Mr. Daniel said, you can just use compare instructions. I don't know an SFC or SFB that compares date and time one shot. I hope someone knows better. I've attached an example where comparisons of individual bytes take place in OB1. You might just have faced a problem regarding type check of address. The comparison instructions in LADDER starts with INT comparisons where you have to compare word(size) by word(size) not byte with word or byte with byte. If you do so, you will have a message telling you Actual data type BYTE doesn't fit the formal type INT of the formal parameter. To overcome such a problem, you should do any of the following, 1- Write these simple lines in STL from the beginning. 2- In program editor go in Options>Customize>LAD/FBD and remove the check mark behind Type Check of Address (Check the PDF in zip file) I don't recommend to remove this check mark but if you don't want to write STL, just remove it and write your code in LADDER and when you finish testing your code check the box again and save, your code (comparisons part) will be automatically switched to STL. Best regards. H-H AttachmentDate and time folder.zip (529 Downloads) |
8/29/2014 10:47 AM | |
Joined: 9/1/2005 Last visit: 8/24/2023 Posts: 4102 Rating:
|
new question published by boycementois split to a seperate thread with the subject Date and time - EQ_DT block. Best regards CS Moderator |
My Forum is the place to personalize your profile, |
|
Follow us on