Reading multiple addresses from MC Protocol (Mitsubishi FX PLC)

Tell me the highest ,nn count number that works.


To make this easier - use this flow:

the highest ,nn count number worked for me is 50
rest i tried the example flow you send for testing the highest count number upto 100 but didnot worked

Did you run the demo flow to assess this?

show me a screenshot

yes didnot worked for that

Did you press the "read next address" until it got down to 50?

show me a screen shot.

please dont take any short cuts - please do as I ask.

@Steve-Mcl
i tried it all way but i get the data when it come to 62


in this image i started from 70 and then it was showing data on 62, why i tried from 70 because i was confused a bit from starting 100 there were only timeout error

ok, that fine.

now try this flow

[{"id":"ee548f43b60a3cfb","type":"inject","z":"99321f37fd961305","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":140,"wires":[["3fc9a582ec030e99"]]},{"id":"17483553facc8081","type":"debug","z":"99321f37fd961305","name":"part 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":140,"wires":[]},{"id":"151485cfc8585f0a","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"extrusionRodNumber","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"extrusionTime","offset":2,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureGiven","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureSetting","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"chamdaDe","offset":30,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaob","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaoa","offset":34,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"freagem","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"limitPressureOfMasterCylinder","offset":42,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc4","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc3","offset":46,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc2","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":50,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"fillingPressureGiven","offset":52,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"slopeGivenOfBreakthroughPressure","offset":54,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationRatio","offset":58,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationStroke","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"maximumStrokeGiven","offset":68,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload1","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":140,"wires":[["17483553facc8081","a3c6cd2ccde899bf"]]},{"id":"3fc9a582ec030e99","type":"change","z":"99321f37fd961305","name":"D990,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D990,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":140,"wires":[["a1057e4a80c0d287"]]},{"id":"a1057e4a80c0d287","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":140,"wires":[["151485cfc8585f0a","eef6eca7504c7085"]]},{"id":"ce9c462e93a1e8d3","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"actualValueOfCoil","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"breakthroughPressure","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"residualPosition","offset":72,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderPosition","offset":74,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rateOfDecay","offset":76,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfMainCylinder","offset":82,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"speedGiven","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"settingPointOfCoil","offset":86,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfSideCylinder","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"coilCurrent","offset":90,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderSpeed","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload2","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":260,"wires":[["dd70bbf1fcc54974","e1898eb76bbd3abe"]]},{"id":"a3c6cd2ccde899bf","type":"change","z":"99321f37fd961305","name":"D1040,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D1040,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":260,"wires":[["bdbcd691d033c3d1"]]},{"id":"bdbcd691d033c3d1","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":260,"wires":[["7f04a5965542d46f","ce9c462e93a1e8d3"]]},{"id":"eef6eca7504c7085","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":100,"wires":[]},{"id":"7f04a5965542d46f","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":220,"wires":[]},{"id":"dd70bbf1fcc54974","type":"debug","z":"99321f37fd961305","name":"part 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":260,"wires":[]},{"id":"e1898eb76bbd3abe","type":"function","z":"99321f37fd961305","name":"merge payload1 & payload2","func":"msg.payload = {\n    ... msg.payload1,\n    ... msg.payload2\n}\ndelete msg.payload1\ndelete msg.payload2\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":340,"wires":[["dd3a59aded3ed544"]]},{"id":"dd3a59aded3ed544","type":"debug","z":"99321f37fd961305","name":"final result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":340,"wires":[]},{"id":"16dbc1e8e4c7b0f1","type":"group","z":"99321f37fd961305","name":"Read PLC Subroutine","style":{"label":true},"nodes":["38e76ddd4c78d4d9","eaccb1754fe661ae","3cc8f41d3137cbf6","f7fbc71a773c84f4","395888bce11d8592"],"x":84,"y":439,"w":492,"h":142},{"id":"38e76ddd4c78d4d9","type":"MC Read","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":260,"y":480,"wires":[["3cc8f41d3137cbf6"]]},{"id":"eaccb1754fe661ae","type":"link in","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read PLC Subroutine","links":[],"x":125,"y":480,"wires":[["38e76ddd4c78d4d9"]]},{"id":"3cc8f41d3137cbf6","type":"link out","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"return","mode":"return","links":[],"x":405,"y":480,"wires":[]},{"id":"f7fbc71a773c84f4","type":"catch","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","scope":"group","uncaught":false,"x":270,"y":540,"wires":[["395888bce11d8592"]]},{"id":"395888bce11d8592","type":"debug","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read Error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":460,"y":540,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

show me what you get

@Steve-Mcl
I got it but the thing is would i need to sort the address list
first screenshot
for debug PLC data 1

for debug part 1

for rest

Good, so now you have 100 data items read in 2 chunks, all nicely assembled into a singe object.

Now if you want X, Y and M values, tell me what they are in a list like this...

Address Name
Y4 powerOn
Y5 machineReady
Y9 inCycle
M22 overCycle
etc etc
etc etc
etc etc
OUT OUTPUT NAME ADDRESS TAG
Y0 SOL PUMP COMBINATION Y 0
Y1 CONSTANT SPEED Y 1
Y2 CONTAINER FORWARD OIL RETURN Y 2
Y3 CONTAINER BACKWARD OIL RETURN Y 3
Y4 SEMI AUTO MODE Y 4
Y5 BACK UP Y 5
Y6 OUT KNOCKER UP Y 6
Y7 OUT KNOCKER DOWN Y 7
Y10 MAIN RAM PRESSURE RELIEF VALUE Y 10
Y11 CONTAINER HEATING Y 11
Y12 NO LOAD ELETRICAL CURRENT Y 12
Y13 SPEED 1 ADJUSTMENT CURRENT Y 13
Y14 SPEED 2 ADJUSTMENT CURRENT Y 14
Y15 SPEED 3 ADJUSTMENT CURRENT Y 15
Y16 SPEED 4 ADJUSMENT CURRENT Y 16
Y17 SPEED 5 ADJUSTMENTCURRENT Y 17
Y20 MAIN RAM FORWARD Y 20
Y21 MAIN RAM BACKWARD Y 21
Y22 CONTAINER FORWAD Y 22
Y23 CONATINER BACKWARD Y 23
Y24 SHEAR DOWN Y 24
Y25 SHEAE UP Y 25
Y26 OIL COMBINATION Y 26
Y27 SURGE VALVE OPEN Y 27
Y30 BILLET LOADER FORWARD Y 30
Y31 BILLET LOADER BACKWARD Y 31
Y32 PULLAR START Y 32
Y33 PULLER STOP Y 33
Y34 DIE SLIDE IN Y 34
Y35 DIE SLIDE OUT Y 35
Y36 BILLET PUSHING CYLINDER FORWARD Y 36
Y37 BILLET PUSHING CYLINDER BACKWARD Y 37
Y40 PISTON PUMP OVERFLOW VALVE 1 Y 40
Y41 PISTON PUMP OVERFLOW VALVE 2 Y 41
Y42 VANE PUMP OVERFLOW VALVE 1 Y 42
Y43 VANE PUMP OVERFLOW VALVE 2 Y 43
Y44 SURGE VALVE CLOSE Y 44
Y45 120L pump overfllow valve Y 45
Y46 piston pump overflow valve 3# Y 46
Y47 1# motor on Y 47
Y50 1# motor on Y 50
Y51 1# motor on Y 51
Y52 2# motor on Y 52
Y53 2# motor on Y 53
Y54 2# motor on Y 54
Y55 3# motor on Y 55
Y56 3# motor on Y 56
Y57 3# motor on Y 57
Y60 back up Y 60
Y61 constant speed Y 61
Y62 air cylinder forward Y 62
Y63 shear up Y 63
Y64 vane pump overflow valve 3# Y 64
Y65 piston pump overflow valve 4# Y 65
Y66 cooling pump on Y 66
Y67 die slide forward Y 67
Y70 die slide backward Y 70
Y71 container sealing 1 Y 71
Y72 container sealing 2 Y 72
Y73 stem out Y 73
Y74 stem in Y 74
Y75 billet pushing forward Y 75
Y76 billet pushing backward Y 76
Y77 stem lock-up Y 77
Y100 oil combination Y 100
Y101 container sealing on Y 101
Y102 main ram backward oil return Y 102
Y103 billet loader enable Y 103
Y104 forward inching Y 104
Y105 backward inching Y 105
Y106 high speed inching Y 106
Y107 billet loader searching home position Y 107
Y110 position of billet loader backward Y 110
Y111 position of billet loader forward Y 111
Y112 pistion 3 Y 112
Y113 billet loader reaching home position Y 113
Y114 power of billet loader Y 114
Y115 back up Y 115
Y116 back up Y 116
Y117 container heating2 Y 117

this are output y addresses

Run this flow:

[{"id":"5cf897a3fbea442e","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1240,"wires":[["79bcbec04a949f2e"]]},{"id":"660df0a113c4dae3","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Y0,120","x":450,"y":1240,"wires":[["5cf897a3fbea442e"]]},{"id":"79bcbec04a949f2e","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1240,"wires":[]},{"id":"7be52be29e860b1f","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K2Y0,16","x":460,"y":1300,"wires":[["0d15654de772c499"]]},{"id":"0d15654de772c499","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1300,"wires":[["306c7cf39ba72617"]]},{"id":"306c7cf39ba72617","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1300,"wires":[]},{"id":"f449e2485b31eef4","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1360,"wires":[["f1235dab7ede68cc"]]},{"id":"9de73af43582dd80","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K4Y0,8","x":450,"y":1360,"wires":[["f449e2485b31eef4"]]},{"id":"f1235dab7ede68cc","type":"debug","z":"99321f37fd961305","name":"PLC Data 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1360,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

Show me all three payloads

@Steve-Mcl
before that D990 and D1040 with final output in debug

{"extrusionRodNumber":0,"extrusionTime":2,"temperatureGiven":420,"temperatureSetting":195,"rapida":400,"chamdaDe":4000,"protecaob":3000,"protecaoa":2000,"freagem":1000,"limitPressureOfMasterCylinder":280,"veloc4":400,"veloc3":400,"veloc2":400,"fillingPressureGiven":100,"slopeGivenOfBreakthroughPressure":10,"velocityAttenuationRatio":0,"velocityAttenuationStroke":0,"maximumStrokeGiven":15653,"actualValueOfCoil":0,"breakthroughPressure":0,"residualPosition":12303,"masterCylinderPosition":3350,"rateOfDecay":0,"pressureOfMainCylinder":0,"speedGiven":0,"settingPointOfCoil":204,"pressureOfSideCylinder":0,"coilCurrent":0,"masterCylinderSpeed":0}

it does not consist 100 tag addresses from both tag

Run this flow:

[{"id":"5cf897a3fbea442e","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1240,"wires":[["79bcbec04a949f2e"]]},{"id":"660df0a113c4dae3","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Y0,120","x":450,"y":1240,"wires":[["5cf897a3fbea442e"]]},{"id":"79bcbec04a949f2e","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1240,"wires":[]},{"id":"7be52be29e860b1f","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K2Y0,16","x":460,"y":1300,"wires":[["0d15654de772c499"]]},{"id":"0d15654de772c499","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1300,"wires":[["306c7cf39ba72617"]]},{"id":"306c7cf39ba72617","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1300,"wires":[]},{"id":"f449e2485b31eef4","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1360,"wires":[["f1235dab7ede68cc"]]},{"id":"9de73af43582dd80","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K4Y0,8","x":450,"y":1360,"wires":[["f449e2485b31eef4"]]},{"id":"f1235dab7ede68cc","type":"debug","z":"99321f37fd961305","name":"PLC Data 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1360,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

Show me all three payloads


@Steve-Mcl
i got two right and the middle one got error

No, it contains the items specified in the Buffer Parser.

If you WANT 100 items, you will have to include them in the Buffer Parser like I did.

I did a selection for demonstration purposes.

I cannot do everything for you. I have given you the knowledge, you will have to do some things yourself.

Now try this flow - show me the output of final Result (expand all parts)

[{"id":"ee548f43b60a3cfb","type":"inject","z":"99321f37fd961305","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":140,"wires":[["3fc9a582ec030e99"]]},{"id":"17483553facc8081","type":"debug","z":"99321f37fd961305","name":"part 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":140,"wires":[]},{"id":"151485cfc8585f0a","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"extrusionRodNumber","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"extrusionTime","offset":2,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureGiven","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureSetting","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"chamdaDe","offset":30,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaob","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaoa","offset":34,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"freagem","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"limitPressureOfMasterCylinder","offset":42,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc4","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc3","offset":46,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc2","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":50,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"fillingPressureGiven","offset":52,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"slopeGivenOfBreakthroughPressure","offset":54,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationRatio","offset":58,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationStroke","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"maximumStrokeGiven","offset":68,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload1","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":140,"wires":[["17483553facc8081","a3c6cd2ccde899bf"]]},{"id":"3fc9a582ec030e99","type":"change","z":"99321f37fd961305","name":"D990,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D990,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":140,"wires":[["a1057e4a80c0d287"]]},{"id":"a1057e4a80c0d287","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":140,"wires":[["151485cfc8585f0a","eef6eca7504c7085"]]},{"id":"ce9c462e93a1e8d3","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"actualValueOfCoil","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"breakthroughPressure","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"residualPosition","offset":72,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderPosition","offset":74,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rateOfDecay","offset":76,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfMainCylinder","offset":82,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"speedGiven","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"settingPointOfCoil","offset":86,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfSideCylinder","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"coilCurrent","offset":90,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderSpeed","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload2","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":260,"wires":[["dd70bbf1fcc54974","fc265c85f748fb8d"]]},{"id":"a3c6cd2ccde899bf","type":"change","z":"99321f37fd961305","name":"D1040,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D1040,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":260,"wires":[["bdbcd691d033c3d1"]]},{"id":"bdbcd691d033c3d1","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":260,"wires":[["7f04a5965542d46f","ce9c462e93a1e8d3"]]},{"id":"eef6eca7504c7085","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":100,"wires":[]},{"id":"7f04a5965542d46f","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":220,"wires":[]},{"id":"dd70bbf1fcc54974","type":"debug","z":"99321f37fd961305","name":"part 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":260,"wires":[]},{"id":"e1898eb76bbd3abe","type":"function","z":"99321f37fd961305","name":"merge payloads","func":"msg.payload = {\n    ... msg.payload1,\n    ... msg.payload2,\n    Y: {\n        ...msg.payload3\n    }\n}\ndelete msg.payload1\ndelete msg.payload2\ndelete msg.payload3\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":420,"wires":[["dd3a59aded3ed544"]]},{"id":"dd3a59aded3ed544","type":"debug","z":"99321f37fd961305","name":"final result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":420,"wires":[]},{"id":"fc265c85f748fb8d","type":"change","z":"99321f37fd961305","name":"K4Y0,120","rules":[{"t":"set","p":"topic","pt":"msg","to":"Y0,120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":340,"wires":[["bafe2d392b393fdb"]]},{"id":"bafe2d392b393fdb","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"0","errorHandling":"throw","outputs":1,"x":420,"y":340,"wires":[["4c29f73c76822417"]]},{"id":"4c29f73c76822417","type":"change","z":"99321f37fd961305","name":"set payload3","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload3","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":340,"wires":[["e1898eb76bbd3abe"]]},{"id":"16dbc1e8e4c7b0f1","type":"group","z":"99321f37fd961305","name":"Read PLC Subroutine","style":{"label":true},"nodes":["38e76ddd4c78d4d9","eaccb1754fe661ae","3cc8f41d3137cbf6","f7fbc71a773c84f4","395888bce11d8592"],"x":64,"y":499,"w":492,"h":142},{"id":"38e76ddd4c78d4d9","type":"MC Read","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":240,"y":540,"wires":[["3cc8f41d3137cbf6"]]},{"id":"eaccb1754fe661ae","type":"link in","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read PLC Subroutine","links":[],"x":105,"y":540,"wires":[["38e76ddd4c78d4d9"]]},{"id":"3cc8f41d3137cbf6","type":"link out","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"return","mode":"return","links":[],"x":385,"y":540,"wires":[]},{"id":"f7fbc71a773c84f4","type":"catch","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","scope":"group","uncaught":false,"x":250,"y":600,"wires":[["395888bce11d8592"]]},{"id":"395888bce11d8592","type":"debug","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read Error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":440,"y":600,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

Yes i know that you helped me a lot with a real example thank you for that no doubt the other thing i have to do.
But

@Steve-Mcl
i need to know that how to find bytes offset and index offset

Do you know what a 16 bit value is?

Do you know what a BYTE is?

1 MC READ value is 16 bit AKA 2 bytes.

therefore:

  • If you get 3 16bit values [xxxx, yyyy, zzzz] then xxxx is bytes 0 & 1, yyyy is bytes 2 & 3, and so on.
  • if you read D990,50, then D990 is byte 0 & 1, D991 is bytes 2 & 3 ... D1024 is bytes 68 & 69, and so on.
  • if you read D1040,50, then D1040 is byte 0 & 1, D1041 is bytes 2 & 3 ... and so on.

It is simple maths.

Byte Offset = (Address - Start Address) * 2

e.g.
Address: D1048
Start Address: D1040
Byte Offset = (1048 - 1040) * 2 = 16

Read this again:

You might have missed this post ↑

@Jayeshpitale1

I am going to leave you to do this by yourself now.

I have spent over 4 hours of my own personal time, across the last few days helping you - I think that is enough.

I have given you a LOT of demos, a LOT of information and enough tips and hints to put this all together by yourself.

Best of luck. Steve.

1 Like

i got it Both the thing are in one D tag and Y tag address

Now what about D_bit Address Means it is show Boolean in Kep and when i add it to MC protocol a single address i need to use Like this D1088.2 for D_bit 108802

Add a BOOL as i have explained twice already

Here is it one last time.

Calculate the offset to the DM, enter the BIT number, give it a name