LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Documentation for the Method "Replace No Attributes".

I am trying to use the "Replace No Attrib" Method and the documentation appear to be lacking.

RCF replace no att.pngRCF replace no att doc.png

After some trial and error I got the following:

  1. Changing parameter 1 from 0 to 1 changes the returned error from 1 to 1054 (which seem to indicate that parameter 1 could/should be 1)
  2. Changing parameter 2 from 0 to anything (while parameter 1 is 0) will crash LabVIEW.

I am not even remotely close to figure out the right parameter combination, so I would really appreciate some help here.

Thanks in advance.

PJM



  


vipm.io | jki.net

0 Kudos
Message 1 of 5
(3,837 Views)

PJM_JKI,

  I dug around the LabVIEW internals for this method, and can relate that LabVIEW is expecting a style argument in 'Param 0', and a path argument in 'Param 1'.

  'Param 2', 'Param 3', 'Style', and 'Path' are completely ignored.

  I chatted with another developer familiar with the history of this function.  He relates that the function picked up 'Param 0' through 'Param 3' as an artifact of a transition in the way we internally denote the parameters expected by a VI-Server node.  Since no-one here was using it, and it wasn't a public feature, correcting the parameter list has never been a priority.

  You might be successful in using this function by coercing a style enum into an integer and passing it into this method through 'Param 0'.

  The code I'm looking at expects the address of a path to come in through 'Param 1'.  If you give a non-zero value that is not the address of a path, things will go all kinds of wrong and crash LabVIEW.  I don't know of a way to use G to extract this information from a path, although you might...maybe...be able to work something out with the Call Library node.

  - Trevor Christman

0 Kudos
Message 2 of 5
(3,051 Views)

Trevor,

Thanks for the information.

Using the style ring connected to 'parameter 0' does work (with a 0 connected to all the other required input).

Unfortunately, for my use case, I need to use a path, and even with your hint (I looked at the LabVIEW.exe export function) I am not able to convert the path to its address that is required in 'parameter 1'.

I guess I will have to use the standard replace and live with the fact that copy attributes (such as color) are replaced with the one from the target control.

Thanks again.

PJM



  


vipm.io | jki.net

0 Kudos
Message 3 of 5
(3,051 Views)

Unfortunatly he didn't say what exact address the parameter would need, but I simply assume it is the address of the LabVIEW path handle itself. In that case you should be able to get what is needed with a single CLN to call the MoveBlock() function.

You would configure it as follows:

Library Name: LabVIEW

Function Name: MoveBlock

Call Convention: C

Thread: Run in any Thread

Return Value: void

1st Parameter: path, Constant, Adapt to type, Pass Pointers to Handles

2nd Parameter: pointer, Numeric, int32 (int64 for 64 Bit LabVIEW), Pass Pointer to Value

3rd Parameter: size, Constant, Numeric, int32, Pass value, connect a constant of 4 (or 8 for 64 Bit LabVIEW)

The Constant is a new checkbox in recent LabVIEW versions. It allows LabVIEW to optimise the passing of parameters because it tells it that the parameter will not be modified by the function.

The pointer could also be configured as Pointer size integer instead, but since the Method in question is unsupported and unused by NI, I doubt they would adjust the undocumented parameter list to use a 64 byte integer as 'parameter 1' so this method very well could be completely unusable in 64 Bit LabVIEW.

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(3,051 Views)

Rolf,

Thank you very much, this works like a charm.

PJM



  


vipm.io | jki.net

0 Kudos
Message 5 of 5
(3,051 Views)