I am supppose to wire up a cluster to a callng library function thru the use of the "adapt to type" configuration.But the program lie in the data types in the struct.
i have call library function that contain two arguement,two inputs i mean.The first input is simply an int which can be easily matched by labview data type.The second input is declared as a structure which i match it thru a cluster by using the adapt to type means.
However,inside the structure there are four variables,two of which is PULONG and the other two is ULONG.Inside my cluster i can match the ULONG by a 32bit unsign integer labview data type but how can i match the PULONG with a labview data type?
There is a great KnowledgeBase entry that discusses using the "adapt to type" option in a Call Library Function, and specifically using clusters.
This KB, titled "I'm Having Trouble Accessing the Members of a Cluster Passed to a Shared Library Such as a DLL" is available at:
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/bc2a65c0fe2868a1862566e80067c4e4?OpenDocument
I found this article by going to www.ni.com, clicking on the KnowledgeBase link, and searching for "call library cluster."
Similar Messages
-
VI analyzer: Wire under object test fails with Call Library Function Nodes
Hi,
If I wire a Call Library Function Node with an ErrorIn and an ErrorOut, the VI Analyzer Test "Wire under Object" fails always with two occurrences per Call Library Function Node.
A double click to the occurrence highlights the error lines connected with the call... node.
The test does not fail, if the error lines are not connected.
Thanks!
H
Solved!
Go to Solution.This became a problem when Call Library Nodes got error terminals (and optional path terminals) in LabVIEW 8.20. I should be able to get a fix in to VI Analyzer Toolkit 2010.
Thanks for taking the time to report the bug.
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman -
Saving cluster of different data types to a file
Hi,
I use LV 8.6 SDK. I need to save clusters of different data types to a file on a disk, row by row.
To be specific: I have a program that performs various investigations on a signal collected by DAQmx. Each time the quality of the signal is not in a specified boundaries, i get an indication. It is a cluster of time stamp, string, dbl, and Boolean. The program is supposed to run for few weeks in a row so there can be a lot of these indications. I expect to have around 200 000 rows a week (Altogether, divided into several groups).
I thought about TDMS but I am not able to save such a cluster. And I would like to save it as tdms cause i could divide the data to different groups. I also thought about data base but that would be the first time i use db and I really do not have time to learn that now.
I know it is possible to change some of the data types to others, ex Boolean to 0-1, but i need a string and a time stamp there.
Can someone advise me which data format should I use? Which one is the best one in this situation?
Thanks in advance
handreIf you do not need to access data from another application (other than Labview) you can just save it as a binary file.
It is the best choice (for me).
I made an example with one cluster. You can replace that with an array of clusters, of that data type.
Attachments:
Example_VI_BD.png 2 KB -
Attaching a Cluster of 2 elements data type to dynamic data type wire.
Hey Folks,
How do I attach a cluster of 2 elements data type of wire with a Dynamic data type wire?
Or a Build XY Graph to a curve fitting2.
Thanks for the help.
TyHi Ty,
Try to use the "Express-VI Curve Fitting" which is at: Functions-> Signal Analysis -> Curve Fit.
You have to put this VI before the "Build XY Graph".
Otherwise, u can convert the siganls types by using the "Convert from Dynamic Data"
which is at : Functions-> Signal Mamipulation -> Convert from Dynamic Data.
Hope it Helps....
The Bush-Man -
I might be asking a really silly school boy question here and to some degree I hope I am but could somebody tell me if its possible to change the data type of a cluster element? Let me explain.
Here is a screen shot of my code:
I read back my test data as an array of strings which I convert to a cluster, bundle then send off on its merry way to do other stuff, however the first element in the cluster is actually a path. As you can see I currently unbundle all elements, change the first to a path then re-bundle with the correct data types. Whilst somewhat messy, this used to be acceptable as I only had two other strings in the cluster, however due to expansion I now look at it and think that there must be an easier, more elegant way to do this if I just want to change one element.
If this is the only way (or at least if no other simpler solution exists) then I could potentially keep the path a a string and do the conversion at the points that require it, however that would now require a bit of re-coding which I would like to avoid if possible.
Hopefully I'm just not thinking hard enough on this one.
Cheers for looking
Mitch
Solved!
Go to Solution.I have no idea what the rest of the code looks like and how much you can change so a few options:
1. Keep them all as strings, do the path conversion when you actually need the path. I'll show you the trick I use to convert arrays to nicely labelled clusters below.
2. Make the cluster an object, keep the data as a string array and the accessors deal with indexing and path conversion.
3. Make the cluster hierarchial, separate the path and have a second cluster which is all strings.
4. If you want you can jigger the string array and use some flatten and unflatten action.
The top of the snippet is one way to jigger the string array to get a path for the first element in a flat cluster (should wire seamlessly to the rest of your code). The lower code shows how I would convert a string array to a cluster so the labels are useful, same idea works for clusters which are given useless labels such as those from Array to Cluster. (Fixed sized clusters with brown wires are easier to handle, simply Type Cast to the cluster with the same types and appropriate labels).
Judging from your original post, you know when and how to Type Def the various clusters I show. -
Pointer to struct in call library function
I have a dll function with this prototype:
DWORD CAN_Read(TPCANMsg* pMsgBuff);
where TPCANMsg is a structure.
typedef struct{
DWORD ID;
BYTE MSGTYPE;
BYTE LEN;
BYTE DATA[8];
}TPCANMsg;
I create a cluster that is represented as a structure. But in Call Library Function witch do I have to choose: "Handles by Value" or "Pointers to Handles"?> I have a dll function with this prototype:
> DWORD CAN_Read(TPCANMsg* pMsgBuff);
> where TPCANMsg is a structure.
> typedef struct{
> DWORD ID;
> BYTE MSGTYPE;
> BYTE LEN;
> BYTE DATA[8];
> }TPCANMsg;
> I create a cluster that is represented as a structure. But in Call
> Library Function witch do I have to choose: "Handles by Value" or
> "Pointers to Handles"?
The key is to make sure the type is set to Adapt. The setting of the
Data Format shouldn't matter since your datatype doesn't have a string,
array, path, or other nonflat data element.
for the DATA[8], you will want to use eight inline U8s, or a cluster of
the bytes.
The info I'm going on is the LV External Code manual.
Greg Mckaskle -
Get image of Data Type of wire
Hello,
I know how to return the image of a front panel or diagram using VI server however I'm looking to be able to return the same image as displayed within the 'Data Type of Wire' information in the Context Help window when I hover my mouse over a wire. I thought this may be achieveable by returning a reference wire to a Front Panel Control and then maniulpate the methods/properties of that to try and return it but I can't find anything that will do the job. . .
Im asking because I have an object that stores another set of differenet objects and hovering over the highest most class returns a good diagram to show all of the data memebers within the system.
Any ideas on how to get programatic access to that image?
Cheers
TomI think you guys missed the point of the original poster.
When you hover over an LVclass wire, you see the content of the class cluster in the context help window. If the class includes other instances of other classes in its cluster, those classes are also displayed in the context help window.
Tom wants to get that picture. The problem is that what you're seeing is not a preset picture. It's probably a tree which is dynamically generated when you hover over the wire and is probably done in the C code with no visible interface in LabVIEW (definitely not a public one).
I can think of a couple of option:
1. The easy one is probably to programmatically open the CH window, position the mouse over a wire of your class (will require some access to private properties. Look at LAVA forums scripting forum to see how you can access these), and then capture the entire screen and cut out the part of the image which has the CH window.
2. The somewhat harder one is to rebuild this yourself. There's a class API in the LAVA forums code repository which should return the structure of the class. You can use that to recursively parse the cluster and build a tree of all the elements.
Why do you want to do this?
Try to take over the world! -
How I pass a cluster with array of various data type (double, I32, string)
I have to pass from a VI to a Microsoft Visual C++ DLL, a cluster with some arrays of various data type. The problem is with Double array, that during Visual C debug is incorrect:the dimension is correct passed, but not array data. In the DLL I have inserted the C code genereted by LabVIEW. I tried to pass a cluster of only one array of double, and the results is the same. Then, I tried to pass a cluster with scalar number and the result is correct in only one case. If the double data is the first in the cluster, the result is correct; if the first is another data type, such as integer or boolean, the double data is incorrect during the debug of the DLL.
This is the code of my DLL:
// LabViewP
aram.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "LabViewParam.h"
#include "extcode.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
switch (ul_reason_for_call)
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
return TRUE;
typedef struct {
long dimSize;
double elt[1];
} TD2;
typedef TD2 **TD2Hdl;
typedef struct {
TD2Hdl elt1;
} TD1;
// This is an example of an exported variable
LABVIEWPARAM_API int nLabViewParamPass=0;
// This is an example of an exported function.
LABVIEWPARAM_API int LabViewParamPass(TD1 *pparam)
double parametro;
int i;
for (i=0;i<(**(*pparam).elt1).dimSize;i++)
parametro=(**(*pparam).elt1).elt[i];
return 42;
// This is the constructor of a class that has been exp
orted.
// see LabViewParam.h for the class definition
CLabViewParam::CLabViewParam()
return;
I use LabVIEW 7.0 and Windows XP.
Sorry for my english.
Thanks to every one for your suggestions.
Filippo> I have to pass from a VI to a Microsoft Visual C++ DLL, a cluster with
> some arrays of various data type. The problem is with Double array,
> that during Visual C debug is incorrect:the dimension is correct
> passed, but not array data. In the DLL I have inserted the C code
> genereted by LabVIEW. I tried to pass a cluster of only one array of
> double, and the results is the same. Then, I tried to pass a cluster
> with scalar number and the result is correct in only one case. If the
> double data is the first in the cluster, the result is correct; if the
> first is another data type, such as integer or boolean, the double
> data is incorrect during the debug of the DLL.
It is hard tell for sure, but you might have alignment problems. The
key symptom
is that you can pass a cluster of big and small fine, but
small big doesn't pass correctly. You might also test this by seeing
what the size of your struct is. For Boolean and Double, sizeof()
should return nine bytes no matter what order the array is in. If you
are getting different sizes, you have two options. You can either order
them such that the sizes work, or you can build the EXE or a wrapper DLL
so that the alignment matches LV's native alignment.
Greg McKaskle -
The data type is
typedef enum {false, true} bool;
typedef float flt4;
typedef double flt8;
typedef int i32s;
typedef unsigned int i32u;
typedef short int i16s;
typedef unsigned short i16u;
typedef signed char i08s;
typedef unsigned char i08u;
struct t_UnwrapData {
struct {
i08u flags;
i16u unwrap_m;
i08u weight_m;
} status;
flt4 *ph2pi;
flt4 *weight;
flt4 *gamma;
flt4 *phase;
i08u *flags;
i08u *neigh;
i32s neighOfst[8];
i32s r,c;
i32s x0,y0,xSz,ySz;
flt8 unwTime;
flt4 binCut;
Please Could someone help me suggesting how I pass this dat
a type to call library function?Hi Setu,
Here is a solution that I have been playing to return back an array of clusters
typedef struct
int32 dimSize;
uInt8 array[1];
} LVU8;
typedef LVU8 **LVU8Hdl;
typedef struct
U32 DeviceId;
U32 VendorId;
U32 BusNumber;
U32 SlotNumber;
LVU8Hdl SerialNumber;
} LVDEVICE_LOCATION;
typedef LVDEVICE_LOCATION **LVDEV_LOC_HANDLE;
typedef struct
int32 dimSize;
LVDEVICE_LOCATION cluster_array[1];
} LVDEV_LOC_ARRAY;
typedef LVDEV_LOC_ARRAY **LVDEV_LOC_ARRAY_HANDLE;
LVPLX_API void GetAllDevices(LVDEV_LOC_ARRAY_HANDLE cluster_array)
int i,j;
int numDevices = 3;
DSSetHandleSize(cluster_array, sizeof(int32)+3*(sizeof(LVDEV_LOC_ARRAY)+(sizeof(int32)+16*sizeof(L
VU8))));
(*cluster_array)->dimSize = 3;
(*((*cluster_array)->cluster_array[0]).SerialNumber)->dimSize =16;
(*((*cluster_array)->cluster_array[1]).SerialNumber)->dimSize =16;
(*((*cluster_array)->cluster_array[2]).SerialNumber)->dimSize =16;
for(i=0; i<3; i++)
((*cluster_array)->cluster_array[i]).BusNumber = i;
((*cluster_array)->cluster_array[i]).VendorId = i*5;
for(j=0;j<16;j++)
(*((*cluster_array)->cluster_array[i]).SerialNumber)->array[j] = (10*j)+i;
The code doesnt do much but returns back 3*cluster which the array in my cluster is sized for 16. The problem I've been having , was ensuring I have allocated enough memory to handle the complete structure. This works for me, now all I have to do is put the real code in which get my array of data from the instruments.
Hope it helps
Regards
Ray Farmer
Regards
Ray Farmer -
How to get the values from struct data type using java code..?
Hi ,
I am newer to java.
we are using oracle database.
How to get the data from struct data type using java code.
Thanks in Advance.
Regards,
kumarHi Rajeev,
To retrieve a FilterContainer you will need to traverse the report structure:
ReportStructure boReportStructure = boDocumentInstance.getStructure();
ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);
FilterContainer boFilterContainer = null;
if (boReportContainer.hasFilter()) {
boFilterContainer = boReportContainer.getFilter();
} else {
boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.
Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.
Hope this helps.
Regards,
Dan -
How do I pass an array of structs to a C function using the dll flexible prototype adapter?
What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
I can pass in a single struct of type TPS_Data and that works, but not an array.
Here's the relevent code:
typedef struct TPS_DATA
char Report_Number[256];
char System_Name[256];
char Open_Date[256];
char UUT_Part_Number[256];
char UUT_Serial_Number[256];
char UUT_Name[256];
char Open_Employee_Name[256];
char Open_Employee_Number[256];
char Close_Employee_Name[256];
char Close_Employee_Number[256];
char Close_Date[256];
} TPS_Data;
typedef struct TPS_DATA_ARRAY
TPS_Data DataRecord;
} TPS_DataArray;
long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);OK,
I can pass the data to the DLL function, using the following types:
typedef struct StringArrayType
char string[10][256];
} StringArray;
typedef struct MultiStringArrayType
StringArray Record[10];
} MultiStringArray;
void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
return;
void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
return;
But when the MultiStruct function Exits, TestStand reports an Error:
-17501 "Unexpected Operating System Error" Source: 'TSAPI'
There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
ctions shown above.
Any thoughts on how to get around this error would be greatly appreciated.
Attachments:
StructArrayPassing.seq 16 KB -
What is the use of GEN_USR_ORA_STATIC_VIP & GEN_USR_ORA_VIP in a cluster resource
add an entry in on both the nodes /etc/sysconfig/network DEFAULT_GATEWAY
eg:-
[oracle@rac1 ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rac1.localdomain
DEFAULT_GATEWAY=192.168.1.10
and try to start the service.
if you would like refer:-http://oracleinstance.blogspot.com/2009/12/crs-0215-could-not-start-resource.html -
Red Hat Cluster Suite without the use of RAC
Hi,
I want to install Oracle 9i/10g database on two nodes in linux redhat AS 3. I want to use Red Hat Cluster Suite for clustering and failover the Oracle db without the use of RAC. Is it possible and would it be sufficient enough ? Does Red Hat Cluster Suite support with Oracle 10g or just 9i ? With Red HAt Cluster Suite, would it require to have one virtual IP ?
ThanksIf you want failover all you need is a dataguard solution and skip out on cluster suite.
If you want Distributed Database then you need RAC.. You can't implement a 9i/10g cluster per say by using an OS solution vs an Oracle solution.
Node A - Primary
Node B - Secondary
Node A -> B (DataGuard redo replication)
Process Management scripts to switch users from A to B and vice versa pending recovery of instances. Cluster suite has no involvement outside of what may be nice nice system management capability. -
"could not deteremine data types of all wires"?
OK, so I am porting a pretty large project over to LV8 from LV7.0
And for one of my VIs I am getting the error "could not deteremine data types of all wires"
When I double-click on the error, it brings up the front panel.
huh?
I don't see any problems with the block diagram at all.
All of my shift registers have colored wires, so I assume that the wires' data types are resolved.Update II: Apparantly this bug is somehow related to the enum's name (and maybe location on disk?).
I re-created the enum from scratch under the name "Trial Enum STYP.ctl" when I dropped it into a new subVI's diagram it didn't break the VI.
I renamed it "Main STYP.ctl" and dropped it in; broken VI
I renamed it "Trial Enum 1 STYP.ctl"; broken VI
I renamed it "Trial Enum STYP.ctl" again; not broken.
Here be dragons!
Note: I actually got one to work by opening it when it was named something "good", and then using "Save As..." from within LabVIEW to change the name to what I wanted instead of changing the name in Windows Explorer.
Message Edited by LVRob on 12-06-2005 03:33 PM -
How do you deploy an Event view to a cluster using the RDBMS 1.0 adapter in WLI7?
Hi ,
We are trying to deploy an application view representing a database event in a
table to a cluster consisting of 2 WLI servers.
When you get the deploy screen in the wlai console it prompts you for a url for
the event Router.
On a single instance of WLI this is simply http://localhost:7001/BEA_RDBMS_1_0_EventRouter/EventRouter
but what should this be in the case when the adapter is deployed to a cluster
of 2 machines??
We have tried replacing localhost:7001 with the ip and ports of either of the
two WLI servers as well as trying the admin server ip and port but always get
the error show below.
has anyone succesfully done this?
any ideas greatly appreciated
Adam
com.bea.wlai.client.DeploymentException: ConnectionFactoryDeployer on cscw00336440:
Failed to upload weblogic-ra.xml descriptor for connection factory OrderDetails_connectionFactory
due to a communication problem with the Admin server; Unexpected exception in
com.bea.wlai.admin.RARUploadSessionBean.upload(): java.net.ConnectException: Tried
all: '1' addresses, but could not connect over HTTP to server: 'www.bea.com',
port: '80' at weblogic.net.http.HttpClient.openServer(HttpClient.java:222) at
weblogic.net.http.HttpClient.openServer(HttpClient.java:274) at weblogic.net.http.HttpClient.(HttpClient.java:126)
at weblogic.net.http.HttpClient.New(HttpClient.java:168) at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:111)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:281)
at java.net.URL.openStream(URL.java:793) at weblogic.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFactory.java:149)
atTry downloading the DTD from BEA to your filesystem and change the XML
so it points to it.
Ricardo
Adam Finlayson wrote:
Hi Chris,
Thanks for that bit of info. We have pinned the eventgenerator to just one managed
server now but are still getting the same error when trying to deploy an event
application view.
The admin server appears to be trying to contact the bea website for some reason
as part of the deployment.
I am guessing this must be trying to access some DTD or something but this system
sits behind a firewall so any http requests would need to go through a proxy.
Any idea why it may be contacting www.bea.com or how to set up WLS to use a proxy
server?
Chris Stead <[email protected]> wrote:
Hi Adam,
Due to the nature of the the event generator Web application (WAR) URL,
you have to pin the war file to a single server in your cluster. Here
is some information about deploying adapters in a cluster:
http://e-docs.bea.com/wli/docs70/deploy/cluster.htm#1454929
I hope this helps with your deployment.
Cheers,
Chris
Adam Finlayson wrote:
Hi ,
We are trying to deploy an application view representing a database
event in a
table to a cluster consisting of 2 WLI servers.
When you get the deploy screen in the wlai console it prompts you for
a url for
the event Router.
On a single instance of WLI this is simply http://localhost:7001/BEA_RDBMS_1_0_EventRouter/EventRouter
but what should this be in the case when the adapter is deployed to
a cluster
of 2 machines??
We have tried replacing localhost:7001 with the ip and ports of either
of the
two WLI servers as well as trying the admin server ip and port but
always get
the error show below.
has anyone succesfully done this?
any ideas greatly appreciated
Adam
com.bea.wlai.client.DeploymentException: ConnectionFactoryDeployer
on cscw00336440:
Failed to upload weblogic-ra.xml descriptor for connection factory
OrderDetails_connectionFactory
due to a communication problem with the Admin server; Unexpected exception
in
com.bea.wlai.admin.RARUploadSessionBean.upload(): java.net.ConnectException:
Tried
all: '1' addresses, but could not connect over HTTP to server: 'www.bea.com',
port: '80' at weblogic.net.http.HttpClient.openServer(HttpClient.java:222)
at
weblogic.net.http.HttpClient.openServer(HttpClient.java:274) at weblogic.net.http.HttpClient.(HttpClient.java:126)
at weblogic.net.http.HttpClient.New(HttpClient.java:168) at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:111)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:281)
at java.net.URL.openStream(URL.java:793) at weblogic.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFactory.java:149)
at
Maybe you are looking for
-
How to connect my shuffle to my iPad
How to connect my iPod shuffle 2 nd gen to my iPad
-
How do I create a jtable with horizontalScroll bar,plz help me!
I created a jtable component,Because my table's columns has 50 items,I must need a horizontalScroll Bar. but I find the horizontalScroll don't display,when I add record to the jtable,the verticalScroll Bar is showed.How do I create a jtable with hori
-
Images appear as question marks
I need help! I just uploaded my first dreamweaver website to yahoo. My images appear as question marks. I've uploaded the images in file manager along with the index.html. The site looks fine when I preview in all browsers from dreamweaver. The files
-
IPhone 5 Starts then Shutdowns after main screen?
So, i have had this phone for about a month and half, and one day my phone died on me then i got my charger and charged it. It showed that it was at 1% charging when youu see the battery symbol red and at 1 bar. I left it alone for about 20 mins, sti
-
Need to add custom fields in Report RM06EN00 ( Tcode ME2N ) in the Output
Hi, MY requirement is i need to add 10 custom fields in the standard program RM06EN00 whos tcode is ME2N. i have appended the fields in the EKKO table and they r now available in the dynamic selection screen of the report RM06EN00. But i nee