User:Steven J. Koch/Notebook/Kochlab/2009/03/04/Ridding main program of RLP

From OpenWetWare
< User:Steven J. Koch‎ | Notebook‎ | Kochlab‎ | 2009‎ | 03‎ | 04
Jump to navigationJump to search

Steven J. Koch 00:16, 5 March 2009 (EST): Now I have all the modules at least with the basic changes necessary to get rid of RLP from each module. Now they all have the "DAQmx cluster in" and outs. Those need to be connected somewhere. The first prime suspect is "RLP Config," which will probably be replaced with the DAQmx creation and task starting, etc.

Having trouble programming the AI channels without changing anything major about DAQ config file formatting

Steven J. Koch 00:46, 5 March 2009 (EST): The gains I should be able to just calculate the min and max from the gain (assuming bipolar). Channels is more difficult. One idea is to hard-code an array of the physical channels (0 through 15) and then index this array. That would make the code only work for 16 channel boards, which is probably OK.

WOW, that took like 3 hours, but I think I figured it out--How to set the "convert clock" rate


Steven J. Koch 02:27, 5 March 2009 (EST): The above is a code snippet that is what's replacing the RLP stuff for analog input. It's pretty simple, actually, but it took me forever to figure out that AIConv.Rate is what I need to set to be able to adjust settling time (we used 6 microseconds). Also, I am using it with a call to SampleClock timing, which may not be recommended, but was the only way I could get it to work. Also, I had trouble learning about physical channel names in DAQmx, and I finally decided to create the string as seen in the code.