Jump to content

Waste of memory with DAQmxWrite and Mathsript array output.


Recommended Posts

I fill an array (left side in picture) that I want to send to DAQmxWrite (right side in picture). In practical my array has only 2 different values and an INT8 type would be sufficient. However DAQmxWrite does only accept double arrays. Therefore I have to waste memory. Is there a solution?

post-11132-1244196278.png?width=400

Download File:post-11132-1244197380.vi

Also it's not possible anymore to define array outputs in Mathscript as integer. Also if I have integer within the Mathscript node I'm compelled to convert them to douple type. In previous versions of LV this was possible.

Link to comment

QUOTE (horatius @ Jun 5 2009, 03:13 AM)

I fill an array (left side in picture) that I want to send to DAQmxWrite (right side in picture). In practical my array has only 2 different values and an INT8 type would be sufficient. However DAQmxWrite does only accept double arrays. Therefore I have to waste memory. Is there a solution?

Why don't you just use a smaller array and use regeneration mode? If your input array is really complicated, then you can write some code to check the output status, and write to the output buffer in stages, keeping well ahead of the DAQ write mark. Granted, this is not as simple as the code you posted, but if you are running into memory problems, that's an easier fix than waiting while NI ignores your request to change the API.

Link to comment

Yes I tried already in regeneration mode. I posted it here (German Labview Forum). I can translate it if you think you can help and don't speak German.

The problem was that in regeneration mode the PC worked unstable. The buffer couldn't filled as fast as necessary. The problem occured sometimes only after few hours of working. Then I tried to increase the buffer but failed. I think I didn't increase the buffer in the right way. You can look the VI (posted link above) and maybe you know how to adjust the buffer properly. Opposite in non-regeneration mode the PC works without problems or interruptions but the array length can be very large.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.