Search found 4 matches

by dummzeuch
Tue 6. Apr 2021, 18:36
Forum: PCAN-Developer 4
Topic: wrong Delphi implementation of GetParam for CAN_PARAM_NETCLIENTS
Replies: 1
Views: 3171

wrong Delphi implementation of GetParam for CAN_PARAM_NETCLIENTS

The Delphi implementation for GetParam reading a can_param_string255_t looks like this:

class function TCanApi4.GetParam(const device: can_device_t; const paramType: Word;
const objClass: can_objclass_t; const objHandle: Longword; out value: AnsiString)
: can_status_t;
var
param: can_any_param ...
by dummzeuch
Mon 22. Mar 2021, 10:39
Forum: PCAN-Developer 4
Topic: Relation between bus errors in CANAPI2 and CANAPI4
Replies: 1
Views: 3519

Relation between bus errors in CANAPI2 and CANAPI4

I am in the process of moving our software from CANAPI2 to CANAPI4 and am a bit puzzled about the meaning of the bus errors:

CANAPI2 had these:
CAN_ERR_BUSLIGHT = $0004; // Bus error: an error counter reached the 'light' limit
CAN_ERR_BUSHEAVY = $0008; // Bus error: an error counter reached the ...
by dummzeuch
Fri 5. Mar 2021, 17:43
Forum: PCAN-Developer 4
Topic: Delphi VCL sample locks up when using "Read using an Event"
Replies: 2
Views: 3615

Re: Delphi VCL sample locks up when using "Read using an Event"

A workaround is to pass a timeout to the MonitorEnter call in RefreshMessages, like this:


procedure TMainForm.RefreshMessages;
var
msg: TCanMessage;
Item: TListItem;
begin
if System.MonitorEnter(FReceivedMessages, 100) then begin
try
for msg in FReceivedMessages do begin
Item ...
by dummzeuch
Fri 5. Mar 2021, 17:11
Forum: PCAN-Developer 4
Topic: Delphi VCL sample locks up when using "Read using an Event"
Replies: 2
Views: 3615

Delphi VCL sample locks up when using "Read using an Event"

I have just compiled the Delphi VCL sample provided with PCAN-Developer 4 and tried it.
When I select "Read using an Event" on the "Messages" tab, the program locks up after a while.

That's because the VCL thread is waiting in the System.MonitorEnter call in RefreshMessages for access to the ...