12-15-2005 05:42 AM
12-20-2005 03:57 AM
12-20-2005 11:17 AM
Thanks for the response. After some trial and error I reached the same conclusion.
I have a motion application that I am extending by adding code for contoured moves. This code does initialise the 7358 and all existing fuctions worked as expected. The additional flex_configure_buffer returned the error code -70078 which indicates a parameter error. I then ran the example code attached in my original message and received the same error message.
After posting the message I carried further investigation using MAX and after making subtle changes and initialising the board from MAX, the example code did run. I usually find the error reporting from the API to be quite good, but in this case I found it confusing as it did not seem to be related to an initialisation error.
The range for the parameter ReqInterval appears to be 10ms to 45ms. Do you know if this is correct? The documentation does not indicate the valid range for this parameter.
12-22-2005 09:17 AM
Hi,
The minimum time interval for a contour move is 10ms. However, this minimum is dependent upon the PID rate for the controller.
In the event that the requested interval cannot be achieved, the actual interval is determined by the following equation:
a = (p/1000) * ceiling[(r*1000)/p]
For this equation, a represents the actual interval, p is the PID rate and r is the requested interval. Ceiling means that the results of the calculation in brackets will always be rounded up.
If you have a look at the NI-Motion function help for the flex_configure_buffer call, there's a lot of information on how the reqinterval acutally works.
The minimum time interval for a contour move is 10ms. However, this minimum is dependent upon the PID rate for the controller.
For buffer types of
NIMC_GENERAL_PURPOSE_INPUT
NIMC_GENERAL_PURPOSE_OUTPUT
the requestedInterval parameter is ignored. In early versions of the driver, you had to set this to 10, however now it is full ignored.
requestedInterval specifies the requested time in milliseconds between contouring data points. interval is valid for only a bufferType of NIMC_POSITION_DATA, NIMC_BREAKPOINT_DATA, or NIMC_HIGH-SPEED_CAPTURE_READBACK.
The controller uses the closest legal value that is greater than or equal to the requested value for interval. Legal values for interval must be even multiples of the PID rate. See actualInterval for more information.
When used with NIMC_BREAKPOINT_DATA or NIMC_HIGH-SPEED_CAPTURE_READBACK, requestedInterval indicates how often, in milliseconds, the onboard data is updated from the hardware, and the value is a whole number.
actualInterval is the interval of time in milliseconds that the controller uses between successive points in the buffer. actualInterval may or may not be the same as the requestedInterval. For example, if the requestedInterval is physically impossible, then a different value is used. This value is represented as actualInterval.
For NIMC_BREAKPOINT_DATA or NIMC_HIGH-SPEED_CAPTURE_READBACK,
12-22-2005 09:17 AM
NIMC_POSITION_DATA
For NIMC_POSITION_DATA, use the following equation to calculate the actual interval, rounded to the next microsecond:
where r = requestedInterval in milliseconds (ms)
a = actual interval in milliseconds (ms)
p = PID rate in microseconds (µs)
For example, given a PID rate of 250 ms, a time interval of 11.2 ms between points is physically impossible, but a requestedInterval of 11.25 ms can be accomplished. So a call to Configure Buffer with interval set to 11.2 configures the buffer for 11.25 ms, because that is the shortest possible interval that is greater than or equal to the requested interval. The actual value being used, 11.25 in this case, is returned as an output parameter. The following table shows the minimum and maximum intervals for all valid PID rates.
PID rate | Minimum Interval | Maximum Interval |
---|---|---|
62.5 ms | 10.0 ms | 11.3125 ms |
125 ms | 10.0 ms | 22.625 ms |
187.5 ms | 10.125 ms | 33.9375 ms |
250 ms | 10.0 ms | 45.25 ms |
312.5 ms | 10.0 ms | 56.5625 ms |
375 ms | 10.125 ms | 67.875 ms |
437.5 ms | 10.0625 ms | 79.1875 ms |
500 ms | 10.0 ms | 90.5 ms |
12-22-2005 10:16 AM - edited 12-22-2005 10:16 AM
Ooops - missed the formulas as inserted images there ...
For NIMC_BREAKPOINT_DATA or NIMC_HIGH-SPEED_CAPTURE_READBACK,
For NIMC_POSITION_DATA, use the following equation to calculate the actual interval, rounded to the next microsecond:
Thanks
Sacha Emery
National Instruments (UK)
Message Edited by SachaE on 12-22-2005 04:19 PM