PLIN-API USB location

LIN Interface for USB
Post Reply
MarioRodrigues
Posts: 3
Joined: Fri 8. May 2020, 21:06

PLIN-API USB location

Post by MarioRodrigues » Sun 10. May 2020, 22:51

Hello,

Is there any way to get some information about the USB location of a PLIN-USB using the PLIN-API?

We're using two adapters on one PC and we would like to simplify to replacement in case of a breakdown.
We know that one way to accomplish such requirement is editing and using the Hardware IDs, but this is always a manual setup.
Our idea is to use the USB location to figure out which PLIN is connected to which bus.

Thanks in advance!

Best Regards,
Mário.

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1140
Joined: Fri 10. Sep 2010, 19:34

Re: PLIN-API USB location

Post by U.Wilhelm » Mon 11. May 2020, 08:29

You could set a unique Hardware ID for each Device within the Control Panel APP.
PLIN-View.jpg
PLIN-View.jpg (39.98 KiB) Viewed 374 times
With the Software API you could read the ID back, and so could decide wich PLIN-USB Device is on which LIN Channel.
PLIN-View2.jpg
PLIN-View2.jpg (51.42 KiB) Viewed 374 times


At the moment this is the only solution. There is no "fixing" of the Device to a LIN Channel (like we have implemented it on the CAN units)
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

MarioRodrigues
Posts: 3
Joined: Fri 8. May 2020, 21:06

Re: PLIN-API USB location

Post by MarioRodrigues » Tue 12. May 2020, 16:35

Thank you for the reply.

I'm currently implementing the update of the HardwareID with the API but the ID is not really updating.

When I execute the SetHardwareParam everything goes fine, but when I read it back the value doesn't update (I've confirmed with PLIN-View PRO).
Capture.JPG
Capture.JPG (20.28 KiB) Viewed 364 times
Any ideas?

Best Regards,
Mário.

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1140
Joined: Fri 10. Sep 2010, 19:34

Re: PLIN-API USB location

Post by U.Wilhelm » Tue 12. May 2020, 17:45

Have you test if you could set the ID with Control Panel - as we wrote in our last post? If yes, could you read it with your code back?
Does this work ? We could give you a short C code example how to Set & Get the parameter - simply send us a e-mail to support[at]peak-system.com
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

MarioRodrigues
Posts: 3
Joined: Fri 8. May 2020, 21:06

Re: PLIN-API USB location

Post by MarioRodrigues » Tue 12. May 2020, 18:11

Yes it works fine, if I set the ID with PLIN-View PRO, I can read it back in my app.

I found out the problem, I was setting wBuffSize to 0 as you can see in the picture of my last post. Now that I understand the purpose of such parameter it's weird that the method accepts it to be 0 without "complaining".

Thank you for your support.

Best Regards,
Mário.

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1140
Joined: Fri 10. Sep 2010, 19:34

Re: PLIN-API USB location

Post by U.Wilhelm » Tue 12. May 2020, 18:29

It is a global function that call different subfunction depending on the Parameter (which make it flexible for new features without changing the API)
So a validation is nearl impossible, because there exist parameters where a zero is OK.
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

Post Reply