Good morning everyone,
I'm working on a project where I am recording data from a machine by sending it message packets. Most of the time the data comes back to me correctly, but sometimes (about 20%) the received message comes back with extra characters at the beginning of it.
I have the data coming into a UDT that can store 256 SINT's and the data I need is only using about 122 of those. When the message comes in with the extra characters, the data I need may get shifted down to Data[50] or so.
I know the beginning characters of where the good data begins will always be these values "-33 -5 -3". I created a new tag DataMSG_Start and input these 3 SINT values.
I've been trying to use an FSC instruction to search the UDT to find the position where this pattern begins, but I can only get it to work when searching for one of the values. I can't figure out how to get it find the full pattern? Or is this not possible with the FSC instruction?
I can use the following FSC setup to find a match for one of the single values:
Control: DataSearch
Length: 256
Position: 0
Mode: All
Expressions: Data.SINT[DataSearch.POS] = DataMSG_Start[0]
I've tried using DataMsg_Start[0] AND DataMSG_Start[1] AND DataMSG_Start[2]
but not getting anything with that
Any help would be greatly appreciated!
Thanks
I'm working on a project where I am recording data from a machine by sending it message packets. Most of the time the data comes back to me correctly, but sometimes (about 20%) the received message comes back with extra characters at the beginning of it.
I have the data coming into a UDT that can store 256 SINT's and the data I need is only using about 122 of those. When the message comes in with the extra characters, the data I need may get shifted down to Data[50] or so.
I know the beginning characters of where the good data begins will always be these values "-33 -5 -3". I created a new tag DataMSG_Start and input these 3 SINT values.
I've been trying to use an FSC instruction to search the UDT to find the position where this pattern begins, but I can only get it to work when searching for one of the values. I can't figure out how to get it find the full pattern? Or is this not possible with the FSC instruction?
I can use the following FSC setup to find a match for one of the single values:
Control: DataSearch
Length: 256
Position: 0
Mode: All
Expressions: Data.SINT[DataSearch.POS] = DataMSG_Start[0]
I've tried using DataMsg_Start[0] AND DataMSG_Start[1] AND DataMSG_Start[2]
but not getting anything with that
Any help would be greatly appreciated!
Thanks
Last edited: