Beckhoff#TwinCAT3 SizeOF()Function

This Time i will explain the SizeOF() Function.

It is a function to pass variables inside and get the sizes(in bytes count). SizeOf() is very useful, for example if you can trying to implement a Socket Communication between 2 PLCs.

You work flow may be like that:

Open the connection>send the data >receive the data>close the connection.

Then you need to know how big is the data that get from the devices, and also how many bytes that you are planning to send the devices.

Here is a example,

we define some variables as real,int and array, and also the data to get the result.

Then we call the SizeOf() Function.

Now you can see,

Real data is 32bit and 4 is returned.

Int data is 16bit and 2 is returned.

Int Array is the data with length[0..5], so 6*2=12 , 12 is returned.

Footer_Basic

Please Support some devices for my blog

Amazon Gift List

Find ME

Twitter:@3threes2
Email:soup01threes*gmail.com (* to @)
YoutubeChannel:https://www.youtube.com/channel/UCQ3CHGAIXZAbeOC_9mjQiWQ

シェアする

  • このエントリーをはてなブックマークに追加

フォローする