Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #1 
I'm trying to send strobed codes from Monkeylogic to Plexon using the NIDAQ Digital IO ports. I have assigned 'Behavioral Codes' to Port 0 Lines 0-7, and 'Codes Strobe' to Port 1, Line 1. They all feed into the appropriate pins for Plexon to read Strobed words. However, the numbers that Plexon records and the numbers that Monkeylogic should be sending are not the same. For example, when using the 'Test Digital Codes' feature on the Monkeylogic main menu"

Monkeylogic Should Send: 2 4 8 16 32 64 128 256 512 (10x)
Plexon Records: 255 254 253 251 247 239 223 191 127 (10x)

When I look at the output for each of the eight lines during 'Test Digital Codes', I discovered that Lines 0-6 start at 0V and flip to 5V and back in 10-20ms pulses; but line 7 starts at 5V and flips to 0V and back in apx 120ms pulses. It also remains at 5V after the testing has completed. I believe this may be part of the problem.

Can anyone confirm this? If so, is there a way to fix it?
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #2 
It looks like an update to Monkeylogic was released 6 days ago which "Updated digital io control code." Does that mean that this issue will be resolved if I update to the latest version?

--Adrienne
0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #3 
No, that update is about different stuff. I think the obvious answer is that there is something wrong in your cable connection. How are you sure that the assigned lines are fed into appropriate pins? You should provide more information to get an answer. Can you run the following script on your MATLAB and see what Plexon reads?

---------- Beginning of strobe_test.m ----------
code = digitalio('nidaq','Dev1');
addline(code,0:7,0,'Out');
strobe = digitalio('nidaq','Dev1');
addline(strobe,1,1,'Out');

for m=[1 2 4 8 16 32 64 128]
    putvalue(code,m);
    putvalue(strobe,1);
    fprintf('Strobe: %d\n',m);
    timer = tic;
    while toc(timer) < 0.001; end
    putvalue(strobe,0);
    putvalue(code,0);
    while toc(timer) < 1; end
end
---------- End of strobe_test.m ----------
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #4 
Thanks for the reply and test code!

I've verified that the assigned lines should go to the appropriate pins (based on plexon's documentation), but you're absolutely right. The strobe_test code you gave me still results in erroneous codes being recorded through plexon. I'll communicate with plexon re the line assignment.

Thanks again!
0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #5 
Maybe it has something to do with the mode of the Plexon DSP board as well. Since you are using only 8 bits, the DSP board should be set to Mode 2, I think, but maybe it is in Mode 3 (or the other way around).
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #6 
I think Mode 2 might have worked, but unfortunately it's disabled in Omniplex. Solved the problem by switching omniplex digital logic levels to 'High True' and grounding omniplex channels 8-15. (Since, in Mode 3, it expects a 16bit piece of data and the disconnected channels float high.)

Thanks again!
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #7 
New question regarding this. Is it possible to force the 'unused pins' of the digital io to be low and not high? I'm obliged to use a 16 bit strobe signal and would like to send the 8 bit monkeylogic signal, as well as another 8 bits (9-16) set to 0. Currently I am connecting the first 8 lines to monkeylogic as usual; and then another 8 to unassigned lines on the nidaq breakout box's digital io. When I run monkeylogic, sometimes these 'unassigned' values are high and sometimes they are low. I have not identified what the conditions are for the bits to be low - although running Test Strobes may sometimes do it. Can I force unassigned digital io lines to be 0?
0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #8 
I think you meant 15 bits, not 16 bits, from your previous posts. OmniPlex sends out a 15-bit strobe in Mode 3.

It sounds like all 15 lines are already connected between the nidaq breakout box and the OmniPlex. Then just assign all of those 15 lines to Behavioral Codes in MonkeyLogic. As long as you do not send a code larger than 255, the upper 7 bits will be kept 0.
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #9 
I'm afraid I don't know how to assign all 15 lines to Behavior Codes in MonkeyLogic. Originally I had channel 0, lines 0-7 assigned for the behavioral codes, and channel 1, line 1 assigned for the code strobe. I've tried selecting Channels 0,1 and 2 simultaneously, and then lines 0-7 in the next window ( and then re-assigning channel 1 / line 1 for the strobe signal) - but it's not working. Plexon still reads very high (16000+) event codes.
0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #10 
Can you provide more info? What is the product name of your DAQ board? Does it have only 8 digital lines in Channel 0?
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #11 
We're using a PCI-6221, it has 3 channels (0, 1 and 2) and only 8 digital lines in each channel (0-7) respectively.

IMG_1125.JPG 

0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #12 
Okay. Do you know where PFI2 - PFI9 of DEV 1 are going? Are they connected to omniplex digital inputs as well?

In your previous post, you said you grounded omniplex lines 8-15. How did you do it? Did you connect them to DGND?
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #13 
PFI2-PFI9 are indeed going to the omniplex digital inputs (and represent bits 9-15 of the strobed signal it expects). The way I got this working at first was to clip the 8 wires that are currently sticking into PFI2-PFI9 with an alligator clip and connect that to DGND. I didn't like the flimsiness of that solution, so I am trying to have them plugged into the PFI sockets, with their values set to 0.
0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #14 
Good. Then what you need is a way to assign digital lines from multiple ports. There is a patch for it that I posted in the following link.

http://forums.monkeylogic.org/post/errors-in-the-current-ml-package-7752047?pid=1290922224

After this patch, three line selection dialogs will pop up one after another, if you select Channel 0, 1 and 2 together, so that you can choose the lines you need from each port.

The locations of the code that needs to be patched are different from version to version, so I could not tell the exact line numbers of the files to modify in the instructions. If you are not sure what to do, send me initio.m and mlmenu.m from your MonkeyLogic directory and I will do it for you.
0
Adrienne

Junior Member
Registered:
Posts: 10
Reply with quote  #15 
I was able to patch the code and it works! Thanks so much!
0
cooperb138

Junior Member
Registered:
Posts: 4
Reply with quote  #16 
Hello Adrienne &/or Jaewon,

I am have a similar setup & a similar problem. 
we're using PCIe-6323 with the same BNC-2090A connector you have pictured. 
Currently I have been using port 0 lines 0-6 for behavioral codes and port 0 line 7 for the strobed bit and have connected the Plexon bare wire cable to P0 0-7. This works fine, but it would be nice to have a few more bits.
How were you able to set up the omniplex bits 9-15 with PFI2-9 (is the strobed line PFI1?)? Could you share some advice on how to configure this? Sorry, but I just don't have much experience with this end of things.

Thank you,
bonnie

Quote:
Originally Posted by Adrienne
We're using a PCI-6221, it has 3 channels (0, 1 and 2) and only 8 digital lines in each channel (0-7) respectively.

 

__________________
where ever you go, there you are.
0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #17 
According to the pin layout of your device (see the last page of this document), PFI1-7 correspond to Line 1-7 of Port 1 and PFI 8-15 are Line 0-7 of Port 2. (Line 0 of Port 1 is PFI 0, but it is not exposed on BNC-2090A, so we cannot use.) So you can just connect more wires between PFIs and Plexon and select those lines in MonkeyLogic. Selecting lines across multiple ports (like making 15 bits by adding 7 bits from Port 0 and 8 bits from Port 1) needs my code patch. If the code patch instructions are too complicated, just download NIMH MonkeyLogic.
0
cooperb138

Junior Member
Registered:
Posts: 4
Reply with quote  #18 
Thanks Jaewon,

I missed that detail about Line 0 of Port 1! & I think I was confused because I hadn't realized that the Main Menu I/O 'Test' would need the patch as well (I thought the patch was just for assigning ports & lines). Everything is working great now.

Cheers & thanks for getting back so quickly
\(^-^)/

__________________
where ever you go, there you are.
0
kms

Junior Member
Registered:
Posts: 19
Reply with quote  #19 
Hi, 

I have a related problem - while in some plexon files, the event values range from 257-294, in others, it is between 1-38 which are the actual event codes as specified by eventmarker in the ML code. I am not able to nail down the reason for this inconsistency in the range of values across plexon files. 

ML behavioral codes are assigned to P0.0 to P0.7, P1.1-1.8 of DAQ board;
Plexon strobe is assigned to PF1.11 and
RSTART to PF1.12 (I am not sure if it is useful though). Plexon is running in Mode 3; unused pins are grounded by inserting them in DGRND.

Any thoughts/ suggestions are welcome. Thanks.


0
Jaewon

Senior Member
Registered:
Posts: 344
Reply with quote  #20 
I would check if you set the rising/falling edge correctly first.

If it is not the reason, you need to provide more information. The value ranges differ by 256, which indicates your 9th data bit occasionally becomes high. But does it happen in the entire duration of the recording or a short period of recording?

Why are there 16 lines assigned for the behavioral codes? Mode 3 processes only 15 bits.

PFIs are programmable lines. You need to indicate them in terms of the regular port number or with the NI board model number.
0
kms

Junior Member
Registered:
Posts: 19
Reply with quote  #21 
Thank you, Jaewon!

All logic levels are set to High-true and the event value ranges were constant - either (257-294) or (1-38) - within a recording.  

Re-assigning behavioral codes to only 15 channels (instead of 16) seems to have solved the problem for now! Thank you so much!
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation: