Back to top

Reading a Thermocouple in units of 0.1 Degrees C in a PxMM Project

In a KAS project, the following outlines reading a thermocouple temperature in units of 0.1 Degrees C from a AKT-AN-200 or AKT-AN-400 slice I/O module. Note: Reading this note will help you get started working through other AKT thermocouple setups.

First set up the thermocouple including linking to a parameter in the project dictionary, using this screen in the IDE:

THermoPic1.jpg

 

Then, to output the temperature in units of 0.1 degrees centigrade, make 2 ECATWriteData function calls from the KAS project

THermoPic2.jpg

The first call is to set up Feature Register R32 and a second call is to turn cycle communications back on between the thermocouple module and the PxMM EtherCAT master.

The first ECATWriteData FB call contains 2 parts to the 32 bit data word

The first part is the control word which is set up to: 16xE0 (bits 7,6,5  = 1). This first part defines that the second part of the 32 bit word will contain the value to write to the AKT-AN -x00 feature register R32

image

          image

 In this example it is a value of 16x2006 (bits 1,2,and 13  = 1). See the definition below. Note this example is for a Type J thermocouple.  Bits 12 to 15 will be different for other thermocouple types. Example: for a Type K thermocouple it will be 16x1006 ( bits 1,2,and 12  = 1).

THermoPic4.jpg

The second ECATWriteData FB uses the control word part of the command to set the control word to 0. This enables the cyclic transmission of the temperature through EtherCAT to the PxMM:

 

Example 1:

In the attached .kas project is the following code:

image

The 2 ECATWriteData FBs must be called once for each thermocouple in the system. Each thermocouple will have a unique ECATWriteData address that can be determined by exporting and opening the EtherCAT ENI  configuration file. The ENI file is available from the IDE by exporting it here :

THermoPic6.jpg

The offset address 124 in the example above is specific to the particular system configuration used in this example. This sample project has 2 AKDs, a remote I/O input module, and the thermocouple module. To determine what the address would be for your system, in your project after completely defining the EtherCAT network, look in the EtherCAT ENI file.

After exporting the ENI file to a web server or another SW that can work with xml files, open the xml file. The top level looks like this:

image

Open the ProcessImage/Output Section and look for the: AKT-AN-x00-000. Output.C1 Ctrl :

image

To calculate the byte offset  to use in the ECATWriteData FB, take the bit offset in the file, in this case 992 and divide by 8 ( 992/8 = 124 ). If the application has more than one thermocouple repeat this process to determine the byte offsets for each thermocouple slice modules

Example 2:

The 2 ECAT function blocks only need to be called once after the EtherCAT network starts up at the beginning of .kas project execution. The following code modifies Example 1. It only calls the ECAT function blocks once when the motion engine starts up (MotionEngineStatus = MLSTATUS_RUNNING) at the beginning of project startup.

 

image

Need More Detail

The Kollmorgen KAS application team can help you more if needed.

For more information on the AKT-AN-200 or AKT-AN-400 slice I/O module, see the attached manual