Java API problems


I updated from 1.2.0 to 1.2.5
Firmware, VHDL library and Java API (.jar and .dll) in the hope of achieving faster throughput.
With the new okjFrontPanel.dll the existing trigger handshaking no longer works.
If I use the older dll the handshaking works, but read from pipe out does not work. I receive -1 only, and the pipe status does not decrement.

any help?


Hi Armin-

Can you provide some more details about how you’re interacting with the API?

What type of handshaking are you doing with triggers? What isn’t working there? What is your call like to ReadFromPipeOut?

Is the DESTester application working under Java for you?


I do use triggers to handshake writing of setup data. I use trigger 0x40 to notify the FPGA of new data availability,I receive trigger 0x61 once data is written to memory. This used to work fine with everything in version 1.2.0

public int doPutData(int data)
throws ReplyValueException, Exception {
int reply = 0;
xilinx_init.m_xem.SetWireInValue((short) 0x01, (short) data,(short) 0xffff);
xilinx_init.m_xem.ActivateTriggerIn((short) 0x40, (short) 2);
while (true != xilinx_init.m_xem.IsTriggered((short) 0x61, (short) 0x1)) {
reply = xilinx_init.m_xem.GetWireOutValue(0x20);
return reply;

I then use a pipe to receive data from fthe FPGA. THis used to work in 1.2.0, but was too slow, presumably because of alternating between reading the pipe and reading the pipe status.

while(status >= 0x0400){	// reading out
len = ( status & 0x000f)*256;
    if (len > 0x0000){
xilinx_init.m_xem.ReadFromPipeOut((short)0xb0, len, buf);
System.out.println("block size " + len );
status =(usb_cmd.doStatus())& 0x040f;



One problem I see is the order of execution of your UpdateTriggerOuts() and IsTriggered().

You check IsTriggered() -before- you call UpdateTriggerOuts() which would actually be using the IsTriggered from the previous check. Similarly, you call UpdateTriggerOuts after IsTriggered() the last time through. This should be:

while (!IsTriggered()) {UpdateTriggerOuts()}

I don’t necessarily mean to imply that this is the problem at hand, but it is something that should be changed. I will look into the Java implementation and see if that is in error.


Can you try the application? You will probably need to change the “okXEM3001” to “okXEM3001v2” in two instances, but aside from that it should work fine.

This test exercises triggers and pipes and works fine for me here on firmware version 2.3 and the FrontPanel 1.2.5 installation.


I tried the DES tester, and it does work fine.
I also did some more debugging, and the problem is on the FPGA side:
It receives triggers from the PC just fine, but when I send a trigger from the FPGA it does not make it to the PC. I realize the DES code does that, and it works, but for now I have switched to edge sensitive handshaking using wires, since this is easier than debugging the vanishing trigger further.

The difference I noticed was that we use the same clock (48MHz) for both the ti and the hi side (we have only that one global clock), while the DES uses the clock from the PLL.



If you’d like, you can send the HDL code (or a snippet?) to and I can take a look at it. While I don’t always catch everything, if I do it may save you a lot of time.