From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-29-2005 01:04 PM
06-30-2005 03:14 AM - edited 06-30-2005 03:14 AM
@H View Labs wrote:
Tried to utilize this NI example: "Using a CIN to Create an Array of Strings in LabVIEW" (http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B4B282BE7EF907C8E034080020E74861&p_node=&p_source=External)
Compiles OK with the makefile made by the LV's lvmkmf utility. Nevertheless when I try to run the VI (with the code loaded into the CIN, of course), LabVIEW 7.1.1 on a SUSE 9.3 Linux machine crashes:
LabVIEW caught fatal signal
7.1.1 - Received SIGSEGV
Reason: address not mapped to object
Attempt to reference address: 0x0
Segmentation fault
Any ideas? Did anybody try this on a Windows machine?
/* resize strarr to hold handles to NUMSTRINGS strings */
err = SetCINArraySize((UHandle)strarr, 0, NUMSTRINGS);
if (err)
goto out;
/* perform this loop once for each element */
/* of array of strings being created */
for (i = 0; i < NUMSTRINGS;) {
LStrHandle handle = (*strarr)->arg1[i];
/* determine length of string that will be element of strarr */
strsize = StrLen(str[i]);
err = NumericArrayResize(uB, 1, &handle, strsize);
if (err)
goto out;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/* moves strsize bytes from the address pointed to */
/* by str[i] to the address pointed to by the data pointer in the handle */
MoveBlock(str[i], LStrBuf(*handle), strsize);
/* manually set size of string pointed to by *strarr */
(*((*strarr)->arg1[i]))->cnt = strsize;
/* manually set dimSize of strarr */
(*strarr)->dimSize = ++i;
}
return noErr;
out:
return err;
Message Edited by rolfk on 06-30-2005 03:15 AM
06-30-2005 08:53 AM
06-30-2005 09:04 AM
@H View Labs wrote:
Thanks for the quick answer, Rolf.
I know you are a real expert (have you written the book yet?) in this but didn't expect you to answer ME (;-))so fast.
Am I lucky, or what? This is the second example I bust NI on this week!
06-30-2005 10:07 AM
06-30-2005 10:36 AM
@H View Labs wrote:
I refuse to believe YOU have have posted something that would be plain wrong. Maybe your code didn't work under some particular coditions - I can accept that possibility. However this code just never works! Means they didn't bother to run it even once before posting.
Do you think we should submit the correct example as an EXAMPLE (name it almost the same but add "(really working)" or something), so that other people don't stumble on the wrong one anymore, or this post would be enough?
Stan
06-30-2005 10:58 AM
06-30-2005 11:03 AM
@H View Labs wrote:
I have added the comments, but doesn't look like they are gonna be displayed on the page. So the only hope is that NI will pay attention to the comment and correct the example themselves. Until they do, people will stumble on it.
07-07-2005 10:44 AM