I'm working with the usb-dio32hs using the universal library for windows. I've connected my sensor to PD01 and GND and set my trigger using the following code which is c# and I've set my pattern to be the listenString.
message = new ushort[this.contentSize];
MccService.WinBufFreeEx(this.memHandle);
memHandle = MccService.WinBufAllocEx(this.contentSize);
ret = DInScan(DigitalPortType.AuxPort, contentSize, ref rate, memHandle, ScanOptions.ExtTrigger);
The pattern never seems to get detected because it never seems to progress past the DInScan method call. I've confirmed that the pattern has been generated correctly. What am I doing wrong.
Update to this post, so I changed
ret = DInScan(DigitalPortType.AuxPort, contentSize, ref rate, memHandle, ScanOptions.ExtTrigger);
to
ret = DInScan(DigitalPortType.AuxPort, contentSize, ref rate, memHandle, ScanOptions.Default);
so it would accept anything and not look at a pattern but turns out that the problem is not that its not seeing the pattern, its not reading any data at all. When I dump the buffer to an array. All I see are zeroes. Its a different problem than what I thought it was.
Question
Mtd001
I'm working with the usb-dio32hs using the universal library for windows. I've connected my sensor to PD01 and GND and set my trigger using the following code which is c# and I've set my pattern to be the listenString.
DConfigPort(DigitalPortType.AuxPort, DigitalPortDirection.DigitalIn);
this.daqBoard.BoardConfig.SetPatternTrigPort(1);
short low = Convert.ToInt16(listenString, 2);
SetTrigger(TriggerType.TrigPatternEQ, low, short.MaxValue);
message = new ushort[this.contentSize];
MccService.WinBufFreeEx(this.memHandle);
memHandle = MccService.WinBufAllocEx(this.contentSize);
ret = DInScan(DigitalPortType.AuxPort, contentSize, ref rate, memHandle, ScanOptions.ExtTrigger);
The pattern never seems to get detected because it never seems to progress past the DInScan method call. I've confirmed that the pattern has been generated correctly. What am I doing wrong.
Update to this post, so I changed
ret = DInScan(DigitalPortType.AuxPort, contentSize, ref rate, memHandle, ScanOptions.ExtTrigger);
to
ret = DInScan(DigitalPortType.AuxPort, contentSize, ref rate, memHandle, ScanOptions.Default);
so it would accept anything and not look at a pattern but turns out that the problem is not that its not seeing the pattern, its not reading any data at all. When I dump the buffer to an array. All I see are zeroes. Its a different problem than what I thought it was.
Edited by Mtd00143 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now