Change the data value of a specific LINID

The free LIN software API (Application Programming Interface) for Windows® (only for usage with the PCAN-USB Pro CAN/LIN interface)
Post Reply
iso32
Posts: 4
Joined: Wed 28. Aug 2024, 11:17

Change the data value of a specific LINID

Post by iso32 » Thu 5. Sep 2024, 11:07

Hello!!
Last time I asked about slave publishing. Thank you so much for your answer. However, I have a problem and would like to ask you again.
When changing the data in the subscriber frame in the slave, LIN_UpdateByteArray enabled the data frame to be changed.
However, if I change the data in the subscriber frame using UpdateByteArray when there is already a slave response, the data value I want to change will not be published, and the data value of the slave that is already responding will change to a completely different value.
In particular, this happens frequently in the first byte of the data (the rest of the bytes were able to change their data frames normally)

[For example]
(Two channels are being used.)

Code: Select all

- LIN data currently being collected
LIN ID: 0x00
LIN Data: 0x01ff

- Bytes of data I want to change
LIN ID: 0x00
(update) LIN data: 0x09ff
mode: slave
direction: publisher

- If I change the data frame by running the code
LIN ID: 0x00
(change value) LIN data: 0x08ff
Error: OtherResponse
I used RegisterClient, ConnectClient, Initialize Hardware, SetFrameEntry, GetFrameEntry, and UpdateByteArray sequentially.

Code: Select all

TLINFrameEntry.FrameId = 0x00
TLINFrameEntry.Length = 2
TLINFrameEntry.Direction = TLIN_DIRECTION_PUBLISHER
TLINFrameEntry.ChecksumType = TLIN_CHECKSUMTYPE_ENHANCED
TLINFrameEntry.Flags = FRAME_FLAG_RESPONSE_ENABLE
Is that a collision or is it a misconfiguration?

Please help me.

Thank you.

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Change the data value of a specific LINID

Post by M.Heidemann » Thu 5. Sep 2024, 12:29

Hello,

how does "UpdateByteArray" look in your case and what's the reponse?

BR

Marvin
---
Marvin Heidemann
PEAK-Support Team

iso32
Posts: 4
Joined: Wed 28. Aug 2024, 11:17

Re: Change the data value of a specific LINID

Post by iso32 » Thu 5. Sep 2024, 12:56

I'm sorry. I didn't understand what you were asking for.

The code I'm writing is...

Code: Select all

#UpdateByteArray
data = (c_ubyte *8)(0x09, 0xFF)
update = LIN.UpdateByteArray(hClient, hHw, 0x00, 0, 2, data)
if update != TLIN_ERROR_OK: print("Failed to UpdateFrameEntry!)
else: print("Update Success")
And the response when I sent it is 0x08FF, 0x01FF, 0x00FF.
ID | Length | Data | Period | Count | Direction | CST | Checksum | Errors

00h 2 08 FF 180 43785 Publisher Enhanced 02h Timeout, OtherResponse
00h 2 01 FF 140 43783 Publisher Enhanced 01h Timeout
00h 2 00 FF 140 43780 Publisher Enhanced 7Fh OtherResponse

Is this information you requested?

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Change the data value of a specific LINID

Post by M.Heidemann » Thu 5. Sep 2024, 15:43

Hello,

Do you send messages manually or do you have a scheduler running?

BR

Marvin
---
Marvin Heidemann
PEAK-Support Team

iso32
Posts: 4
Joined: Wed 28. Aug 2024, 11:17

Re: Change the data value of a specific LINID

Post by iso32 » Fri 6. Sep 2024, 09:00

Hello

I did send messages manually.

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Change the data value of a specific LINID

Post by M.Heidemann » Fri 6. Sep 2024, 09:04

Hello,

can you please tell us, what exactly you want to do?

I would expect a scheduler being involved.

Are you working with a specific node?

Please let us know.

BR

Marv
---
Marvin Heidemann
PEAK-Support Team

Post Reply