This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TIDA-010016: How to send PD-out message from IO-Link Master(TIDA-010016)

Guru 10235 points
Part Number: TIDA-010016
Other Parts Discussed in Thread: TIDA-01335

Hello, Steffen Graf,

 

We continue to check the behavior of IO-Link Master(TIDA-010016) by connecting    

our IO-Link Slave design based on "IO-Link Slave TI-Design" such as TIDA-01335.

https://www.ti.com/tool/TIDA-010016

http://www.ti.com/tool/TIDA-01335

 

As I told before, we can success to find PD-read data in the teraterm console.

Now we try to check LED blinking behavior on the our IO-Link slave by sending PD-data.

So We would like to know where & how to modify TIDA-010016 demo program including "ioLink_autosenTask.c".

Our trial is like below;

- add code in mst_dl_meh.c like below ( line 370..371 )

-  add code in ioLink_autosenTask.c like below; (line 524..539)

- we also add code in ioLink_autosenTasl.h like below ( line 46, 57..60)

-  TeraTerm console log shows like below after rebuid & run .

Result:
It seems PD-out=0x1 0x1 is sent to the our Slave from the log of "PD out"
But this value (0x01 0x01) is not written in the our Slave device from the log of (OD read with index=41)
So, LED of the our SLAVE device didn’t turn on.

We also check the same behavior with below TMG-Master & our Slave on GUI.
www.tmgte.de/.../io-link-device-tool-standard-edition.html 
We found proper behavior like below. (We also found "LED turned on" on the our SLAVE board.)

Questions:

   - Do you have same experience?

   - Is this our code modification correct?

   - Could you tell us where and how to modify the demo code to send PD-out to the Slave?

 

We would appreciate if you check the PD-out sending behavior with your available SLAVE

with TIDA-010016 and tell us recommended code modification.

 

Best regards,

--

  • Hi!

    I have tested PD output with my setup, but I haven't used all the higher layers in the software so far.

    I would recommend you not to change anything on the stack itself, so don't change the mst_dl_meh.c.

    Could you try to directly set the pdOut value in MAL_PDCycle_ind function? And call MAL_Control_req(port, 0); after changing the pdOut value. This is how it works for me.

    Best regards,

    Steffen

  • Hi,

    Thank you very much for your kindness.

    I really appreciate your help.

    I'd like to check the behavior with your advice.

     

    Best regards,

  • Hi,

    Thank you very much for your kindness.

    I really appreciate your help.

     

    I tried to check the behavior to add "MAL_PDCycle_ind()" and "MAL_Control_req(port, 0)" like below in ioLink_autosenTask.c.

    The result is like below;

    Some program in TIDA-010016 demo code overwrite pd-out to 0x99 frequently.

    (This annoy me!)

    Question:

    Could you tell us the recommended code example to send pd-out="0x01 0x01",

    even if some program overwrite "0x99" to pd-out?

     

    I'm sorry to bother you.

    We would appreciate if you send us your successful code including "ioLink_autosenTask.c";

     

    Best regards,

  • Hi,

    I will check and send you some code example by Tuesday.

    Best regards,

    Steffen

  • Hi,

    Thank you very much for your kindness.

    I really appreciate your help.

     

    I'm waiting for your answer.

     

    Best regards,

  • Hi,

    coming back to your question. I tried sending PD data by changing the MAL_PDCycle_ind function in the mst_appl.c file.

    Can you please try to replace the existing MAL_PDCycle_ind function with this code and check what is happening?

    MPL_FUNC_PREFIX void MAL_PDCycle_ind (PortNumT port, BooleanT pdInvalidFlag,
                                          UInteger8T * pdIn,  UInteger8T pdInLength, 
                                          UInteger8T * pdOut, UInteger8T pdOutLength)
    {
        uint8_t i, len;
    
        IOLink_appDataFlags[port].pdFlag    = TRUE;
        IOLink_appData[port].pd.invalidFlag = pdInvalidFlag;
        IOLink_appData[port].pd.inLength    = pdInLength;
        IOLink_appData[port].pd.outLength   = pdOutLength;
    
        len = pdInLength<IOLINK_MAX_APP_DATA_LEN?pdInLength:IOLINK_MAX_APP_DATA_LEN;
        for (i = 0; i < len; i++)
        {
            IOLink_appData[port].pd.inData[i] = pdIn[i];
        }
      
        pdOut[0] = 0x1;
    	pdOut[1] = 0x1;
        MAL_Control_req(port, 0);
        
        IOLink_appDataCounts[port].pdCnt++;
    }

    Best regards,

    Steffen

  • Hi,

    Thank you very much for your kindness.

    I really appreciate your help.

    We can find "LED turned on" on the our SLAVE board with proper pdOut message.

    Thank you!

     

    Best regards,