07-01-2009 06:57 PM
I am trying to use the "Replace No Attrib" Method and the documentation appear to be lacking.
After some trial and error I got the following:
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
07-07-2009 03:25 PM
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
07-07-2009 09:54 PM
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
07-08-2009 12:56 AM
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
07-08-2009 01:43 AM