Page 1 of 1

UDS_SetValue DLL

Posted: Thu 10. Jan 2019, 23:28
by sjash
Hey,

I've been trying to set value on the pcan usb device using the UDS_SetValue dll api. I'm unable to set the values. I get an exception which is as below.
Exception 0xc0000005 0x0 0x1 0x7ffa616767fc
PC=0x7ffa616767fc

syscall.Syscall6(0x7ffa61702920, 0x4, 0x51, 0xe2, 0x1, 0x4, 0x0, 0x0, 0x0, 0x0, ...)
C:/Go/src/runtime/syscall_windows.go:185 +0xfc
syscall.(*Proc).Call(0xc0000544a0, 0xc000058120, 0x4, 0x4, 0x0, 0x0, 0xc000054480, 0x4c26c0)
C:/Go/src/syscall/dll_windows.go:152 +0x39d
PCAN-UDS.UDS.SetValue(0xc000054460, 0x51, 0x1004801e2, 0x4, 0x21, 0xc00007ff38, 0x481baa)
C:/Users/PCAN-UDS/uds.go:57 +0xcc
main.pcanUds()
C:/Users/main.go:61 +0x78
main.main()
C:/Users/main.go:73 +0xb8
rax 0x1
rbx 0x3084580
rcx 0x7ffa616767f6
rdi 0x1
rsi 0x51
rbp 0x85ecd0
rsp 0x85eca0
r8 0xe2
r9 0x4
r10 0x1
r11 0x1
r12 0x7ffa6169fea0
r13 0x0
r14 0x9
r15 0x100
rip 0x7ffa616767fc
rflags 0x10206
cs 0x33
fs 0x53
gs 0x2b
Please could someone here help me resolve this problem.

Also when using PUDS_PARAM_MAPPING_ADD and passing TPUDSMsg struct as value I get invalid parameters.

Re: UDS_SetValue DLL

Posted: Fri 11. Jan 2019, 08:16
by K.Wagner
Hello,

The exception don't offer any useful information. Please first check that you are using the last versions of the APIs. If the problem persists, then provide more information about your case:
  • Which program language are you using?
  • Operating system used
  • Snippet of code where you are seeing the crash

Re: UDS_SetValue DLL

Posted: Fri 11. Jan 2019, 17:43
by sjash
I'm using golang to build an api.
OS : windows 10
PCAN-UDS API Version : 1.3.1.30

I get this error when trying to mapp

Code: Select all


st, _ := u.SetValue(uds.PudsUsbBus1, uds.PudsParamMappingAdd, &request, unsafe.Sizeof(&request))
func (u UDS) SetValue(CanChannel TPUDSCANHandle, Parameter TPUDSParameter, Message *TPUDSMsg, BufferLength uintptr) (TPUDSStatus, error) {
	proc, err := u.TPUDS.FindProc("UDS_SetValue")
	checkError(err)
	res, _, err := proc.Call(uintptr(CanChannel), uintptr(Parameter), uintptr(unsafe.Pointer(Message)), BufferLength)
	return TPUDSStatus(res), err
}
This returns a TPUDSStatus of 8 which is Invalid Parameters

I go that exception dump when trying to set the param debug to true.

Do have a PCAN-UDS api support for linux?

This is the structure of my TPUDSMsg

Code: Select all

//TPUDSMsg Defines a CAN UDS message. The members of this structure are sequentially byte aligned
type TPUDSMsg struct {
	// Network Addressing Information
	NETADDRINFO TPUDSNetAddrInfo
	// Result status of the network communication
	RESULT TPUDSResult
	//States wether Positive Response Message should be suppressed
	NoPositveResponseMsg byte
	// Data Length of the message
	Len uint
	// Type of UDS Message
	MsgType TPUDSMessageType
	// Represents the buffer containing the data of this message
	Data DATA
}

// DATA is the data structure of the TPUDSMsg
type DATA struct {
	RAW []byte
}
UDS_GetValue and UDS_SetValue works fine for all the other Parameters except for UDS_PARAM_MAPPING_ADD

Re: UDS_SetValue DLL

Posted: Mon 14. Jan 2019, 08:47
by K.Wagner
Hello,

sorry but we don't support this programming language. Refer to a Go forum instead, since this problem is not related to the API but to the DLL porting.
sjash wrote:Do have a PCAN-UDS api support for linux?
No, only PCAN-Basic is actually available for linux. The high layer APIs are only available on Windows.