How to call a dll which has one VISA name as input
Hi there,
The Labview application builder can generate a dll file from a vi which is a simple serial comunication program using VISA name as one control.
The problem is how to call the dll file in Labview which has a VISA name as INPUT?
Thanks!
George
I would suggest modifying the LabVIEW VI so that the input is a string control instead of a visa control. The LabVIEW application will work the same and there is no need for any casting. All visa VIs can take a string as an input. Then when you recreate the dll make the input a string. Then you can easily pass a string to the dll from any API.
-Josh
Similar Messages
-
How to call a function which has a cursor
hey folks I have a function which has a cursor,,like this
CREATE OR REPLACE FUNCTION EMPCU RETURN VARCHAR
AS
CURSOR EMPC IS
SELECT LNAME,SALARY,SSN
FROM EMPLOYEE
WHERE DNO IN(4,5);
EMPV EMPC%ROWTYPE;
BEGIN
OPEN EMPC;
LOOP
FETCH EMPC INTO EMPV;
EXIT WHEN EMPC%NOTFOUND;
/*DBMS_OUTPUT.PUT_LINE(EMPV.LNAME||' '||EMPV.SALARY||' '||EMPV.SSN);*/
RETURN EMPV. LNAME ||' '|| EMPV.SALARY||' '||EMPV.SSN;
END LOOP;
CLOSE EMPC;
END EMPCU;
Above function created successfully. I called above function like this
DECLARE
ENAMESAL VARCHAR2(70);
BEGIN
ENAMESAL:=EMPCU();
DBMS_OUTPUT.PUT_LINE(ENAMESAL);
END;
Function is called and function is returning only one row instead of 7 rows. Actually cursor is supposed to return 7 rows but it is returning only one row. Is there any snytax to call a function which has a cursor. So experts please tell me where I have to make changes. I would be very thankful to youWell, you've told the function to RETURN within the loop, so after the first record in the loop, the function returns as you've instructed it.
You would need to change your function to accept a specific input from the EMP table and then do a look up for that specific record and return the values you wanted, and wrap the function call in a loop in your anonymous block.
Or you could just have the anonymous block like this....
BEGIN
FOR X IN
SELECT EMPV. LNAME ||' '|| EMPV.SALARY||' '||EMPV.SSN AS Line_Data
FROM EMPLOYEE
WHERE DNO IN(4,5)
LOOP
DBMS_OUTPUT.PUT_LINE(x.Line_Data);
END LOOP;
END;
/ -
Write a query for which has its field name as input parameter
Hi All,
I need to write a query for SSRS report. StartDate, EndDate and ChangedField are the input parameters.
Let's consider that we are taking employee details. The table contains lot of fields like emp name,add1,add2,city,state,country,designation,rank etc. We have almost 30 fields are there. These field name are coming as input parameter "ChangedField"
. I need to show the records which belong to the start date and end date also data change for the field which is given in the input parameter "ChangedField". That meand If I give ChangedField="city", we need to check for data which
has been updated with new City name in the given time period.
Please suggest.
Regards,
JulieHi Julie,
Per my understanding that you have many fields in the table to be displayed in the report, some of the fields will always show and others should be hide and show based on the selection of the parameters which include the columns names, right?
By default, we can't display columns dynamically in the report automatically without insert this column in the report before. So, in your scenario, I will suggest you to add all the columns in the reports first and then add show/hide expression on
the column visibility based on the selection of the parameter "ChangedField", when some of the fields selectted they will be display, otherwise they will be hidden. For the fields which you want to be always displayed will not need to add the expression
in the column visibility.
Details steps about how to acheive this, please referencet to the article below:
Displaying Dynamic Columns in SSRS Report
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
How to call oracle Function which has If else condition in Data Template
Hi,
currently I am working on creating Data Template which uses a Oracle Function which I need to make use in my data template. But I have some confusions on using the same. Could anybody please help me in this regard.
I have a function like this,
function invoice_query (p_facility_id facility.facility_id%TYPE,
p_wave_nbr pick_directive.wave_nbr%TYPE,
p_container_id unit_pick_group_detail.container_id%TYPE,
p_distro_nbr unit_pick_group_detail.distro_nbr%TYPE) return invoice_refcur IS
refcur invoice_refcur;
begin
IF p_wave_nbr IS NOT NULL THEN
OPEN refcur FOR SELECT t1.distro_nbr,
t1.cust_order_nbr,
t1.pick_not_before_date,
SYSDATE,
t1.ship_address_description,
t1.ship_address1,
t1.ship_address2,
t1.ship_address3,
t1.ship_address4,
t1.ship_address5,
t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
t1.ship_country_code,
t1.bill_address_description,
t1.bill_address1,
t1.bill_address2,
t1.bill_address3,
t1.bill_address4,
t1.bill_address5,
t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
t1.bill_country_code,
min(t2.pick_order),
NULL,
t2.wave_nbr
FROM stock_order t1,
pick_directive t2,
unit_pick_group_detail t3
WHERE t1.facility_id = t2.facility_id
AND t1.facility_id = t3.facility_id
AND t2.facility_id = t3.facility_id
AND t1.distro_nbr = t2.distro_nbr
AND t1.distro_nbr = t3.distro_nbr
AND t2.distro_nbr = t3.distro_nbr
AND t1.facility_id = p_facility_id
AND t2.wave_nbr = p_wave_nbr
AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
AND t2.pick_type = 'U'
AND t3.group_id in (SELECT t4.group_id
FROM unit_pick_group t4
WHERE t4.facility_id = p_facility_id
AND t4.wave_nbr = p_wave_nbr)
GROUP BY t1.distro_nbr,
t1.cust_order_nbr,
t1.pick_not_before_date,
t1.ship_address_description,
t1.ship_address1,
t1.ship_address2,
t1.ship_address3,
t1.ship_address4,
t1.ship_address5,
t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
t1.ship_country_code,
t1.bill_address_description,
t1.bill_address1,
t1.bill_address2,
t1.bill_address3,
t1.bill_address4,
t1.bill_address5,
t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
t1.bill_country_code,
t2.wave_nbr
ORDER BY MIN(t3.group_id), MAX(t3.slot);
elsif p_container_id is not null then
OPEN refcur FOR SELECT distinct t1.distro_nbr,
t1.cust_order_nbr,
t1.pick_not_before_date,
SYSDATE,
t1.ship_address_description,
t1.ship_address1,
t1.ship_address2,
t1.ship_address3,
t1.ship_address4,
t1.ship_address5,
t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
t1.ship_country_code,
t1.bill_address_description,
t1.bill_address1,
t1.bill_address2,
t1.bill_address3,
t1.bill_address4,
t1.bill_address5,
t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
t1.bill_country_code,
NULL,
t2.dest_id,
null
FROM stock_order t1,
unit_pick_group_detail t2
WHERE t1.facility_id = t2.facility_id
and t1.distro_nbr = t2.distro_nbr
and t1.facility_id = p_facility_id
AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
AND t2.container_id = p_container_id;
else
open refcur for SELECT distinct t1.distro_nbr,
t1.cust_order_nbr,
t1.pick_not_before_date,
SYSDATE,
t1.ship_address_description,
t1.ship_address1,
t1.ship_address2,
t1.ship_address3,
t1.ship_address4,
t1.ship_address5,
t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
t1.ship_country_code,
t1.bill_address_description,
t1.bill_address1,
t1.bill_address2,
t1.bill_address3,
t1.bill_address4,
t1.bill_address5,
t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
t1.bill_country_code,
NULL,
NULL,
t3.wave_nbr
FROM stock_order t1,
unit_pick_group_detail t2,
unit_pick_group t3
WHERE t1.facility_id = t2.facility_id
and t2.facility_id = t3.facility_id
and t1.distro_nbr = t2.distro_nbr
and t2.group_id = t3.group_id
and t1.facility_id = p_facility_id
AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
AND t2.distro_nbr = p_distro_nbr;
END IF;
return refcur;
end;
I have created data template like following,
<sqlStatement name="Q_INVOICE">
<![CDATA[
SELECT Pack_Slip_R.invoice_query(:P_FACILITY_ID,:P_WAVE_NBR,:P_CONTAINER_ID,:P_DISTRO_NBR) from dual
]]>
</sqlStatement>
But how does I create a element for the "t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip" column in the oracle function. I normally create an element like following,
<group name="G_INVOICE" source="Q_INVOICE">
<element name="CUST_ORDER_NBR" value="cust_order_nbr"/>
<element name=":dest_id" value="dest_id"/>
</Group>
But how do i create element if a column name is kind of dynamic. Please help. I cannot Rename/change the Column in SQL Query. Please let me know If I could handle this whole logic in BI Publsiher.
Regards,
Ashoka BLtry useing alias
t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip as <COLUMN_ALIAS> -
How to call procedure in which one formal parameter is associative array ty
how to call procedure in which one formal parameter is associative array type,
pls explain with eg.>
above code work fine but when i use case then it give error like
i identifier should be declare
& my code is as
CASE v_array(i)
WHEN 'A' THEN
insert into di_ivpn_report (ID, test_name, table_name, status, entity, proposition)
values (v_att_id, v_att_name, 'DI_'||v_array(i)||'_REPORT'||'_'||v_att_id,
v_status, v_ent_name, v_array(i));
WHEN 'B' THEN
insert into di_mpls_report (ID, test_name, table_name, status, entity, proposition)
values (v_att_id, v_att_name, 'DI_'||v_array(i)||'_REPORT'||'_'||v_att_id,
v_status, v_ent_name, v_array(i));
END CASE;
>
Then you have to use ordinary loop
PROCEDURE insert_update_***_array (TRANID IN VARCHAR2, ATT_NAME IN VARCHAR2, ENT_NAME VARCHAR2, v_array IN ***_array)
IS
v_tranid VARCHAR2(1);
v_att_name VARCHAR2(100) := ATT_NAME;
v_ent_name VARCHAR2(100) := ENT_NAME;
v_att_id VARCHAR2(6);
v_ent_id NUMBER;
v_status VARCHAR2(20) DEFAULT 'INACTIVE';
I NUMBER;
BEGIN
i := v_array.first;
while i is not null loop
CASE v_array(i)
WHEN 'A' THEN
insert into di_ivpn_report (ID, test_name, table_name, status, entity, proposition)
values (v_att_id, v_att_name, 'DI_'||v_array(i)||'_REPORT'||'_'||v_att_id,
v_status, v_ent_name, v_array(i));
WHEN 'B' THEN
insert into di_mpls_report (ID, test_name, table_name, status, entity, proposition)
values (v_att_id, v_att_name, 'DI_'||v_array(i)||'_REPORT'||'_'||v_att_id,
v_status, v_ent_name, v_array(i));
END CASE;
i := v_array.next(i);
end loop;
end; -
How to call LabVIEW dll from ATL COM dll
I have tried to call simple LabVIEW 8.6 Dll from win32 test application, class Library.
I have include LabVIEW generated SharedLib.h file and SharedLib.lib file in the test application which I created as simple win32 console project and also from win32 class Library. I was sucessfully able to call my LabVIEW dll funtion.
But when I create ATL COM project and try to add SharedLib.h file and SharedLib.lib file I used to get following erors
Error 1 error C2733: second C linkage of overloaded function 'StrCatW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 463
Error 2 error C2733: second C linkage of overloaded function 'StrCpyW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 464
Error 3 error C2733: second C linkage of overloaded function 'StrCpyNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 465
Error 4 error C2733: second C linkage of overloaded function 'StrCmpW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 466
Error 5 error C2733: second C linkage of overloaded function 'StrCmpNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 467
these many errors.
Will some one explain me how to call LabVIEW dll from ATL COM dll.
Thanks & Regards,
JayI also had this problem. My application is unicode-aware, but I was attempting to link it to a library with primitive C-string arguments. You could dynamically load the DLL as suggested (more work), modify the header files (really not recommended), or if you are feeling lucky you could try fooling the compiler, as I was successfully able to do in Visual Studio 2010, by steering the preprocessor around those functions (assuming you're not using them, of course -- otherwise this probably wouldn't work):
// prepare for NI extcode.h inclusion. avoid linker errors for this project.
#define StrCatW(a,b) IgnoreLinkError_StrCatW(a,b);
#define StrCpyW(a,b) IgnoreLinkError_StrCpyW(a,b);
#define StrCpyNW(a,b,c) IgnoreLinkError_StrCpyNW(a,b,c);
#define StrCmpW(a,b) IgnoreLinkError_StrCmpW(a,b);
#define StrCmpNW(a,b,c) IgnoreLinkError_StrCmpNW(a,b,c);
// header file for my LabView-built DLL (ASCII single-byte character arguments)
#include <MyLibraryHeader.h>
// clean up afterwards, put things back to 'normal'
#undef StrCatW
#undef StrCpyW
#undef StrCpyNW
#undef StrCmpW
#undef StrCmpNW -
How to call the DLL writing in Vb6.0 from testsatnd?
Hi,
I want to call a dll writting in VB6.0 from teststand. But as i see from the "Step Setting" in teststand, only the C/C++ Dll can be selected in the "adapter" type. I try to use this one as my adapter to call my VB6.0 dll, in result, there is no function can be seen in the "function" tab in teststand.Anyone know how to call the DLL writing in Vb6.0?
Solved!
Go to Solution.Hi Ivan,
Just to be sure that your DLL is not wrong
you have check if all functions are well and present.
There is tool called "Dependency Walker" You can download it at http://dependencywalker.com/ .
With it you can look "inside" your dll
If you will see your functions there, you will see them (in my case !!always!!) in TestStand, too.
Hope this helps
Greetings
Juergen
=s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e= -
How to handle user preference which has "_" and " " in the name
Hi Experts,
I have a question how to handle value which has like "_" and "space" etc in user preference.
If setting "a_b-c d", I could not retrieve this because it's escaped in database.
So this code can't get value even though I can set it.
Is there any restriction of name? Is there any documentation how to code user prefernece which has non alphabet and number in the name?
I know it's possible to handle the data like adding escaped data. But I don't think this is the best way to retrieve the data. Because nobody confirm it's not problem in the future.
Could you tell me the best way to get these user preference?
Thanks in advance,
Masaaki Tada
Here is a sample.
<%@ page contentType="text/html;charset=Shift_JIS" %><%@ page language="java" import="com.plumtree.remote.portlet.*, com.plumtree.remote.prc.*, java.util.*" %>
<%
/** * UserInfo - Simple Page * Display User Information*/
// VariablesIPortletContext oPortletContext = null;IPortletRequest oPortletRequest = null;IPortletUser oPortletUser = null;IPortletResponse oPortletResponse = null;IRemoteSession s;IUserManager oUser;
/* Get Portlet Objects */
try{oPortletContext = PortletContextFactory.createPortletContext(request, response);oPortletRequest = oPortletContext.getRequest();oPortletUser = oPortletContext.getUser();oPortletResponse = oPortletContext.getResponse();} catch (Exception e) {oPortletContext = null;oPortletRequest = null;oPortletUser = null;oPortletResponse = null;}
String val = oPortletRequest.getSettingValue( SettingType.User, "a_b-c d" );String hoe = oPortletRequest.getSettingValue( SettingType.User, "abcd" );out.println( "a_b-c d: " + val );out.println( "abcd : " + hoe );
oPortletResponse.setSettingValue( SettingType.User, "a_b-c d", "aiueo" );oPortletResponse.setSettingValue( SettingType.User, "abcd", "bbbb" );%>Plumtree recommends that user preference names have only alphanumeric characters in them (a-z, A-Z, 0-9). Any non-alphanumeric characters will be encoded by the EDK.
I strongly suggest that you change your user pref name to something that's alphanumeric. However, if that is not possible, you can use the following workaround: in the web service editor, enter the encoded name for the user pref. There are several ways to get the encoded name.
One way is to encode the pref manually, yourself. Plumtree uses the %u encoded format: each non alphanumeric character is converted into %uxxxx, where xxxx is the Unicode representation of the character. For all ASCII characters, just look at the ASCII hex chart. For example, character "-" has a hex value of 2d. So, a preference name "jane_pref" would be encoded to "jane%u002dpref", and you'd enter the latter value on the preferences page in the web service editor.
The other way to find out the encoded value is to set a preference programmatically and use the HTTP tunnel tool to look at HTTP traffic between the portal server and remote server. The remote server will be sending a HTTP header to the portal server (the header name will probably be CSP-User-Pref) and inside the header you should see the pref name, encoded with %u. Just copy it out of there and into the web service editor.
Hope this helps,
Jane -
How to get the records which has a specified x/y coordinates
Hi,
How to get the records which has a specified x/y coordinates. I have a table which has street data. And another table has a point data. Now I just want to get the records from street data which includes the points in the point data table. Can any one give your suggestions
Thanks and Regards
AravindanAravinda,
If you want to find the line segments which intersect the given
set of points, you can do that with SDO_RELATE.
siva -
Can not create an object for my c# form dll which has an ActiveX control
I want to create an object in teststand for my C# form dll which has an ActiveX Control . but the error says ActiveX control can not be instantiated because the current thread is not in a single-threaded apartment. can someone help to solve the problem?
Thanks.Two options:
1) put the step in a subsequence and use the sequence call "New thread" option with the advanced setting "Use single-threaded Apartment". Put a wait step immediately after the sequence call to wait for the new thread.
2) Inside of your dll, using .NET APIs create a new thread initialized as STA and call your code from that. Have the original thread wait for the new thread to finish running your dialog code.
Hope this helps,
-Doug -
How to use the DLLs which created from c++ in Java?
And How to use the DLLs which created from JNI in C++?
Huh?
Are you asking how to do JNI - you should read the tutorial.
Are you asking how to load it - then use System.loadLibrary()
Are you asking what to do with the output from javah - put it in a C file and write some code, compile it into a dll. -
How to open the period which has already closed in MM
How to open the period which has already closed in MM.
1. Lock all users out of PRD
2. Take snapshot of MB5L for all materials at company code for current and previous periods
3. Add User parameter MMPI_READ_NOTE with value = current date in this format YYYYMMDD
4. Stop all processing that updates inventory values
5. Run t-code MMPI with correct period
6. Run Z_DEl_HIST_ENTRIES program
7. Take MB5L snapshot for all materials at company code fs01 for current and previous periods
8. Validate that values match on MB5L pre-post snapshots or are appropriate.
9. Unlock all users in PRD
10. Remove User parameter MMPI_READ_NOTE from user ID
chander -
How to upload a file which has more than 999 line item through BDC ?
Hello Techards
Hi to all
Can any body tell me how to upload a file which has more than 999 line item through BDC for traction F-02 ?
Thanks in advance.
ShovanHello Shovan,
You split it up to post two accounting documents with the help of a "suspense" a/c.
Say, you have to post the following line items below:
line 1 - dr. - GL a/c X - $1000
line 2 - cr. - GL a/c Y - $1
line 3 - cr. - GL a/c Y - $1
line 1001 - cr. - GL a/c Y - $1
You cannot post the above as a single doc in SAP (because of technical reasons), so you need to break it up into 2 documents as below:
Doc1
line 1 - dr - GL a/c X - $1000
line 2 - cr - GL a/c Y - $1
line 3 - cr - GL a/c Y - $1
line 998 - cr - GL a/c Y - $1
line 999 - cr - SUSPENSE a/c - $3
Doc2
line 1 - dr - SUSPENSE a/c - $3
line 2 - cr - GL a/c Y - $3
Note that there is no incorrect impact on accounting as first we credit suspense a/c by $3 and next we debit the same suspense a/c by $3 as a result the effect is nil. Similarly, we credit $997 to GL a/c Y (which is less by $3) in the first doc which is compensated by the second doc by crediting the shortfall of $3.
Hope this helps,
Cheers,
Sougata. -
Hi,
I have created a MFC regular dialog as a dll(TestDialog). And exposed the entire class. Did not expose any specific member function.
Then i created one more MFC dialog based exe and trying to call my dll.
I did the below settings:
Input: TestDialog.lib
Include : header file
Now i am calling as
CTestDialog dlg;
m_pMainWnd = &dlg;
dlg.DoModal().
I am not getting any dialog.
Can anyone please help me on this.
Thankssorry it maybe because of zip file.
i will write a step.
just simple.
i use win32 dll with mfc support with exported some symbol. name DialogInDll
create dialog and create class for it. TestDlg
you will see like this DialogInDll
// This class is exported from the DialogInDll.dll
class DIALOGINDLL_API CDialogInDll {
public:
CDialogInDll(void);
~CDialogInDll();
// TODO: add your methods here.
void showdlg(); // function for the show dialog.
extern DIALOGINDLL_API int nDialogInDll;
DIALOGINDLL_API int fnDialogInDll(void);
//--------------TestDlg .h----------------------------------
#pragma once
#include "resource.h"
// TestDlg dialog
class TestDlg : public CDialogEx
DECLARE_DYNAMIC(TestDlg)
public:
TestDlg(CWnd* pParent = NULL); // standard constructor
virtual ~TestDlg();
// Dialog Data
enum { IDD = IDD_TESTDLG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
//-----------------------------DialogInDll.cpp-------------------------------
// add this code
void CDialogInDll::showdlg ()
AFX_MANAGE_STATE(AfxGetStaticModuleState( )); // this is very important
TestDlg dlg;
dlg.DoModal();
CDialogInDll::CDialogInDll(void)
CDialogInDll::~CDialogInDll()
///compile.....
//===================================
// from exe make function.
// include DialogInDll.h/ copy lib file to source folder / add DialogInDll.lib to linker in project property.
void test ()
CDialogInDll cd;
cd.showdlg ();
cd.la.name = "Test";
CString str(CString(cd.la.name.c_str()));
AfxMessageBox (str); -
How to clear the node which has multiple attributes
Hello ,
how to clear the node which has multiple attributes.
I've tried this using the method SET_STATIC_ATTRIBUTES_NULL but it's not working.
Thanks,
Sandhya.Hello,
I suggest you to create an internal table or structure clear it and the bind it to the context node.
Another possibility is to try to invalidate the node (method INVALIDATE of interface IF_WD_CONTEXT_NODE).
Regards.
Maybe you are looking for
-
Outlook will not open. asking to update browser.
it is allowing to open in mobile only. asks to update browser and i did already. also, i do have a brand new pc, with windows 7. issue started on 1st opening of my hotmail acct.
-
System copy via SAPINST (Export/Import)
Hello! We are using SAP ERP EHP4 system on Windows with SAP MaxDB (Version: 7.7.07.09). We would like to copy this productive system to QAS system. Therefore we successfully run SAPINST (with running db and sap, because we cannot stop productive syst
-
OK I HOOK MY MP3 INTO MY CPU BUT IT WILL NOT CONNECT WHAT DO I DO? HELP PLEASE.:manmad:
-
Undo saved changes in SMS drafts
Hello Everyone, I record very important data at work on my phone and save them as an SMS draft, while I was selecting all the text to be copied, I pasted dfferent data over it. I want to know how I can restore the draft to where it was a day ago for
-
Compiling .java files during program execution.
I have a program that read events in from a file and creates custom Event objects (which extend Thread) from this information, and then later the events are activated depending on the timing information that was provided in the file. Everything works