Now it works with all this settings and changes, thanks.
Posts by andyinfsnet
-
-
Ok, you didn´t confirm but assuming my driver adjustment was ok, now with your new driver I could transmit nearly 5Mb, new record. But now the behaviour is completely different, the communication stopped because the sender just did not send all bytes he should.
So not the receiving but the sending is not doing what it should. May be you have a 2. idea also for this ?
-
This SSMStandardCtrl.exe application is the machine program, acting as a PLC, and it is connected via shared memory to the server.exe application, where the serial and some other stuff for data exchange is running. The priority 100 needs to be there (server.exe).
-
Hello
can you please check if this is what you wanted me to adjust :
-
I have a NdcuA5 on one and a Picocom4 on the other side.
Only one application per device, but also other threads (see example attach). We transmit about say 2000 bytes/ sec in my test, in reality it is less but may increase to such. A Telegram is about 50-60 bytes long, 4 byte overhead the other is data, variable lentgh.
Baudrate 115200, Data 8, Stop 1, parity none.
Both sides may transmit a Telegram any time, but it´s defined that there is a Master and a Slave, so one of both needs to wait in case of collision.
It´s the so called 3964R Protokoll, I think invented from Siemens but am not sure.
The PicoCom side hasn´t these Problems, and the NDCU8 that I used some years long also didn´t do this trouble to me.
Edit: I completely forgot to say, there is also a 2. Application, (in fact the main application...), that also runs on netcdua5, see picture.
-
I did another trial. I use event based communication instead of the above polling.
I set the receiver thread priority to 100, and there is a difference now. It takes much longer until the problem occurs, about 3 Mb I could transmit. The error happens then again, but with the difference that when communication stops, and I send an additional byte, there are now 2 events, the missing byte and the additional byte. In former trials there was only 1 event.
Any ideas now ?
-
This may work:
foreach (var t in OpenNETCF.ToolHelp.ThreadEntry.GetThreads())
{
if (t.ThreadID == thr_HandleSSerialData.ManagedThreadId)
t.SetRealtimePriority(100);
}
I checked it , it works.
-
No doesn´t fit.
"System.Threading.Thread.CurrentThread" Datatype is Thread but I need Datatype IntPtr.
-
Hallo
Beim pollen der serielle Schnittstelle habe ich das Problem, das nach einiger Zeit ein empfangenes byte im Puffer zurückgehalten wird und nicht ausgelesen werden kann.
Erst nachdem ich ein weiteres byte nachschicke, reagiert ReadFile() wieder und ich kann dann 2 bytes sehen, also auch das erwartete welches fehlt. Ich habe das auch schon als event basierende
Lösung programmiert, dort tritt das Problem eher auf.
Hier die Polling Routine, das geht ne Stunde gut, und dann tritt der Fehler auf. Es ist also nicht so dass irgendwas verloren geht, sonder es ist im Puffer drin, nur kann ich es nicht lesen.
Rx und Tx DMA habe ich in der registry eingeschaltet.
public void Poll_Read(ref Queue myQueue)
{
byte[] readbuffer = new Byte[rxBufferSize];
int bytesread = 0;
do
{
// make sure the port handle is valid
if (hPort == (IntPtr)CommAPI.INVALID_HANDLE_VALUE)
{
bytesread = 0;
break;
}
if (!m_CommAPI.ReadFile(hPort, readbuffer, rxBufferSize, ref bytesread, IntPtr.Zero))
{
throw new CommPortException("Serial port -> " + Marshal.GetLastWin32Error());
}
if (bytesread >= 1)
{
lock (myQueue.SyncRoot)
{
for (int b = 0; b < bytesread; b++)
myQueue.Enqueue(readbuffer[b]);
}
}
// Re-specify the set of events to be monitored for the port.
if (CommAPI.FullFramework)
{
m_CommAPI.SetCommMask(hPort, CommEventFlags.ALLPC);
}
else
{
m_CommAPI.SetCommMask(hPort, CommEventFlags.ALLCE);
}
Thread.Sleep(1);
} while (bytesread > 0);
}
-
I use WC6.0, not compact2013
Under compactframework I do not find such a method.
With pinvoke it does not work, have a missing MethodException:
Can't find an Entry Point 'GetCurrentThread' in a PInvoke DLL 'coredll.dll'
-
Hallo
Wie bekommt man unter C# für eine importierte CeSetThreadPriority Methode an den benötigten IntPtr für den Thread Handle ?
[DllImport("coredll.dll", EntryPoint = "CeSetThreadPriority", SetLastError = true)]
public static extern bool CeSetThreadPriority(IntPtr hThread, int nPriority);
Möchte für einen Thread die Priorität auf 150 erhöhen.
Danke.
-
with a cf20 kernel and a cf3.5 kernel it was both ok. Do you think you could update my user kernel concerning this please?
-
Hi, forgot to say I will try current standard kernel now
-
Hello
I use user/customer kernel.
-
For better explanation what I mean, under .net CLR, I try to send a bunch of bytes from NETDCU8 (serially / COM3 / 115200bd), when the bytes are transmitted I see this output on the serial debug interface:
WAIT- for 0x417a5722, mask 0x00000004
WAIT+ for 0x417a5722, mask 0x00000004The bytes are transmitted correctly(port sniffed), only I think this debug output is unusual, may be it is even decreasing performance of the Netdcu8.
Probably it has to do with IOCTL_SERIAL_WAIT_ON_MASK, from the native API, but how to understand and avoid it?I use from OpenNETCF.IO.Serial the property : public byte[] Output { set; } to deliver the bytes to the serial interface.
Please have a look. -
Hello
I use serial communication in netdcu8, does anyone know what this output means(from debug serial interface):
WAIT+ for 0x61489266, mask 0x00000003
WAIT- for 0x61489266, mask 0x00000003
WAIT+ for 0x61489266, mask 0x00000083
WAIT- for 0x61489266, mask 0x00000002
WAIT+ for 0x61489266, mask 0x00000004
WAIT- for 0x61489266, mask 0x00000004 -
That´s fine. Hope today is today
-
Do you know if there was any Kernel version where CAN was really working?
The some latest were not. -
Hello
I have PicoCOM4 Hardware revision 1.2 and want to use CAN Bus from PicoCOM4.
Usually I initalize like this
m_hCAN = CreateFile(pszName, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL );
When doing so GetLastError() returns 55
Looks, thed driver is not available, can you help here?The serial debug output looks like this:
Quote
Copyright (c) 2010 F&S Elektronik Systeme GmbH
Build: Jun 28 2012/09:53:29
INFO:OALLogSetZones: dpCurSettings.ulZoneMask: 0xb
HW-WATCHDOG: ENABLED
FMD: NAND ID:0xec76 --> Samsung: 512MBit (64MB)
FMD: IsBlockBad - Page #: 0x0
FMD: IsBlockBad - Page #: 0x20
FMD: Block 0 to 20 are locked for boot loader
-OEMInit
OALIoCtlHalInitRTC: Year: 2006, Month: 1, Day: 1, Hour: 12, Minute: 0, second: 0
Time returned from OEMGetRealTime: Year: 2006, Month: 1, Day: 1, Hour: 12, Minute: 0, second: 18
Drivers\Builtin\Serial1 - OFF
RestartReason: Reset
FMD: NAND ID:0xec76 --> Samsung: 512MBit (64MB)
FMD: IsBlockBad - Page #: 0x0
FMD: IsBlockBad - Page #: 0x20
FMD: Block 0 to 20 are locked for boot loader
FMD: FMD_OEMIoControl: unrecognized IOCTL (0x71c24).
FSPART: FS partition driver loaded
OEM: Not cleaning system hive
OEM: Not cleaning user profiles
OEM: Not cleaning system hive
DIO-Layout: >=V1.20
PM-NETDCU: STARTED
+OALIoCtlHalGetHWEntropy
OHCI: Version 1.2, ActiveKey = Drivers\BuiltIn\OHCI
I2C: Version 2.5, ActiveKey = Drivers\Active\10
PSS: Version 1.0, ActiveKey = Drivers\Active\11
VDE: Version 1.0, ActiveKey = Drivers\Active\12
Attach moutouchHID
NDIS:Version 1.0
NSPI: Version 3.2, ActiveKey = Drivers\Active\19
WAV: Version 1.0, ActiveKey = Drivers\Active\20
HSMMC: Initializing the HSMMC Host ControllerHSMMC: Version 1.0, ActiveKey = Drivers\Active\21
UART: Version 1.2, Key = Drivers\Active\34
DEBUG: UART0 SYSINTR : 65
BCS: Version 1.2, ActiveKey = Drivers\Active\35
NI2C: Version 3.0, ActiveKey = Drivers\Active\36
DIO: Version 2.3, ActiveKey = Drivers\Active\37
USBFN: Version 1.0, ActiveKey = Drivers\Active\39
USBFN: USB Serial Function Class Enabled : Serial_Class
USBFN: HW_USBClocks::D0
LCD: Version 1.6, ActiveKey =
LCD: Read registry settings from Drivers\Display\LCD
Display-Mode: 100, Name Hitachi TX14D17
Width: 640 Height: 480 Bpp: 16
TCHPDD: Version 1.3, Key = HARDWARE\DEVICEMAP\TOUCH
TCHKEY: Version 1.0, Key = HARDWARE\DEVICEMAP\TOUCH\VirtualKeys
CheckAutoStart: Version 1.5, LaunchNum = 100
NDCUCFG V 50 started. Platform: PicoCOM4
NDCUCFG Open COM1: at 38400 Baud
CreateFile() failed -> ERROR COM1: -
Hello, just a short question
Is it possible to have / enable RS485 interface on the NETDCU8 ?
What would I need to do? Are there drivers availabe?