Threads and passing parameters to it
Hello everyone,
now I play with sons and I am wondering how to change the setting to the thread function.
I created a thread function is
void CVICALLBACK (char id [], char value []) doThread
{
do something
}
and I want to call the thread like this
CmtScheduleThreadPoolFunction (DEFAULT_THREAD_HANDLE, doThread(FIX_ARG1,FIX_ARG2), NULL, & threadID);
But somehow, it does not work. How can I pass strings to the thread function?
Thank you all...
Common to pass data to a thread is to pick everything up in a structure, and then past the address of this structure to the function that installs the thread. Then tapped him, cast the parameter passed to a pointer of type structure, and you can then reference the data. As:
typedef struct {}
int executed;
Short flag;
char string [32];
} structThread, * pstructThread;
...
structThread tData;
...
tData.run = 1;
CmtScheduleThreadPoolFunction (..., & tData,...)
...
int MyThread (void * param) {}
pstructThread td = param (pstructThread);
so that {(td-> run)
...
}
return 0;
}
JR
Tags: NI Software
Similar Questions
-
How to run and pass parameters to the exe file in the txt file.
Hello
I am facing problem with passing parameters in the .exe file, which is run by labview.firstly that I have script .txt with the settings that I have to go to the .exe file. This .exe file is also a software, and this script is written for her. And now I have to create program in labview which should satisfy the following points.
1. I have to use a button named "Run script". If I pressed the button, it should open the browser where I can choose the script .txt file.
2 .exe application is expected open(Path already chossen).
3. After passing the .exe application settings should be closed.
4 and labview should now update its parameter
I just open using Exce.vi .exe file, but I didn't get any idea to do more than this.can someone please help me?
Thanks norbert. CAN I love it? What should I change now? VI attached below...
-
Calling shell script program SQL and passing parameters
Hi guys,.
Greetings from Toronto. Is it possible to move one or more strings as parameters to a sql from shell script program?
Shell script
SQL program (rd_test.sql)# Accept system input parameters p_user_id=$1 p_job_id=$2 sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
As always, this is not something I have to solve that minute. Any help would be appreciated-- Accept system input parameters define p_user_id = &1 define p_job_id = &2 -- Wondering if its possible to pass these 3 parameters from a shell script program. -- (1) rd_test-$p_job_id-3-1.lis -- (2) RD_PRINTER(rd_test,3) -- (3) t_data select t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt'' t_data_dir=''.'' ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' ' ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '|| '$t_data $t_data_dir'||' exit_status=$? check_command' from rd_job_parameter b, rd_job_parameter a where a.job_id = &2 and a.jp_module_id = 'RDTEST' and b.job_id = a.job_id and b.module_id = a.module_id /
and I will think of the problem.
Thank you
REDA
Published by: Raj404261 on June 25, 2009 11:40
Published by: Raj404261 on June 25, 2009 17:29OK, just a few pointers possible if you need to go the way of shell script.
I suggest that you have a separate SQL script for each of your options, which retains the fairly well-defined lines and keeps the maintenance as simple as possible. Therefore, in your shell script, you can have something like:
#!/bin/ksh # Accept system input parameters p_user_id=$1 p_job_id=$2 # Deduce which script you'll call here # using if statements, or even a case: if [[ p_job_id -eq 1 ]] then SQL_SCRIPT=sql_script1.sql else SQL_SCRIPT=sql_script2.sql fi # Or using case case $2 in 1) SQL_SCRIPT=sql_script1.sql; 2) SQL_SCRIPT=sql_script2.sql; 3) SQL_SCRIPT=sql_script3.sql; *) SQL_SCRIPT=sql_script4.sql; esac export ${SQL_SCRIPT} #If you need to query the database at all to deduce which script to cal #Then something like this: SCRIPT_VAR=`sqlplus -s username/password << EOF set heading off set feedback off set verify off SELECT * FROM DUAL; EOF` export {SCRIPT_VAR} SQL_SCRIPT=sql_script${SCRIPT_VAR}.sql # Then just call your script: sqlplus. -s $p_user_id/password @${SQL_SCRIPT}
-
Basic i/o and pass parameters
I'm trying to work with shell scripts and set of stored procedures and I have a few problems with the basics, the manual is simply not seeming to give me the answers to.
I think I can go a long way, I can tell how to proceed:
Create a procedure very very simple that takes one argument (a name of table for example), attributes this arg in a variable, this variable is used in a sql and also uses it to an output file and then returns the results to the file.
Something like this:
Pseudocode
Create procedure testproc (tabname (varchar (200)) AS)
tabowner varchar (200);
BEGIN
coil tabname.out
Select the owner from user_objects where object_name = tabname in tabowner;
"dbms_output.put_line (' the owner of ' | 'is' tabname | tabowner)"
END;
/
Thank you!
FloydHello
You cannot call SQL * Plus commands in PL/SQL, as you try here (although it is possible to use the PL/SQL in SQL * more). If you want to write to a file in PL/SQL, you can use an integrated as UTL_FILE package.
It is quite possible, however, to achieve what you want through SQL * Plus, something like:
#!/bin/ksh export TABLE_NAME=$1 # table passed in to script sqlplus username/password << EOF set pagesize 1000 spool tabname.out BEGIN FOR cur_rec IN (SELECT owner FROM ALL_TABLES WHERE table_name = '${TABLE_NAME}') LOOP dbms_output.put_line('the owner of ' || ${TABLE_NAME} || ' is ' || cur_rec.owner); END LOOP; END; / spool off quit EOF exit $?
-
Hello, I have two questions...
Many examples of security of the site, I noticed the use CFlock tag. Hwoever, when you look at the documentation of CF9, in a specific example of the security of the site that includes user roles (using an application.cfc file) there is no mention of the herds. They are required to authenticate users or not? I don't see why they would. The variable being edited is the status of users (authenticated or not), and since it is in the session scope, it is already unique, no? So why bother with CFLock?
Secondly, how can I redirect a person to the same page that they where after having submitted a form? I have a form letter of new present on all pages of the Web site, and I would like to than the person to return to the same page they where, the when they presented the form.
In pre - mx days, i.e. ColdFusion 4.5, ColdFusion was leaking bad memory with the memory shared as session variables. Popular workarounds should
all reads and writes these variables. That has long been useless, but there are always tons of old code examples and senior developers who continue to utilze this work around. The action of a form page is defined in the
-
Switches and uses parameters in the fragments of the page
I spent the weekend trying to get information on the use and passing parameters into areas (page fragments) with little success.
I use JDev 11.1.1.3. with the merger of ADF for the project.
I got a train set that uses a jspx and is long of 5 elements (all fragments of the page).
I have a page of research as an entry point (page fragment). This contains the main table, the remaining elements (page fragments) in the train are children to the master.
I need to pass the primary key of the mastery of all the fragments and you also have to set the field in the table when records are inserted (it is a data control).
I found no examples - and the tutorial uses no - one Bean support for fragments or primary jspx who maintains the region.
Ideally, the bean of support would be in the jspx that contains the box (as would be, and the fragments are changed).
Also, as the primary key (foreign key in fragments) is never displayed - I'll have to update these keys the records are inserted (some are tables and forms).
I read on the triggers of context - and think that they could be used (inform the parent of selection and insert actions) and the parent may be able to capture and define these values.
I would have thought the DC would have been smart enough to understand the relationship - but alas - I get the error message saying that the foreign key is missing.
I suspect that the domain controller can be unique to each fragment (I updated the scope of Commons - but not sure that this will help).
Can someone give me a hand (I'm sure this has been done before) or point me to an example (tutorial), who can give me information.
Also, is there a way to put an exit point on the train (e.g. as terminus) If users can leave at any time (it is a train not sequential).Page of the fragments in train stations that contain the details of the main line, that you select on the first page, wouldn't have new lines created on these fragments of page automatically linked to your selected master? Therefore no primary key would not even should be passed to fragments of the page because framework would make the link master / detail appropriate for you.
If this is not the case, have you tried using pageFlowScope variable to hold the values through fragments of page? If everything is in the same taskflow, then pageFlowScope variable would be ideal for this. Even if you agree on each train stop, values would be always kept there so you can use them again and again until the workflow ends.
Also, have you taken into account the built in 'CreateWithParameters' operation to set default values during the creation of new lines on the detail of the fragments of page? In this way, you could use passed parameters and set the values of your attributes without writing a single line of backup code bean :)I hope this helps!
Kristjan
-
I need some help w / pop-up windows and pass parameters in both directions.
Page 7 (reports page), I have:
-TXT_P7_SALESREP displays the name of the sales reps selected, by default, all the
-CMD_P7_PICKSALESREP opens the popup window when you click
-H_P7_SALESREPIDLIST stores the list of IDS (used to generate the report) currently selected sales rep
Page 10 (page popup), I have:
-CBL_P10_SALESREP a list check box, all of the VRP (by name)
-H_P10_SALESREPIDLIST stores a list of the IDS of representative sales currently selected
-CMD_P10_OK to submit the changes and close the page
-CMD_P10_CANCEL to close the window without saving changes (I got this work already through the process of close popup window)
The process should be something like:
I tried to put some javascript:popupURL('f?p=&APP_ID.:10:&SESSION.::NO::H_P10_SALESREPIDLIST:&H_P7_SALESREPIDLIST'); in the target URL for CMD_P7_PICKSALESREP, but it did not work. I don't know enough about the passage of parameters and APEX-details to implement myself. Any help would be appreciated.1) User opens report page, 'All' is displayed in the text box, and H_P7_SALESREPIDLIST contains all the sales rep ids 2) User clicks CMD_P7_PICKSALESREP to change list of sales reps 2a) Popup window opens & the value of H_P10_SALESREPIDLIST is set to the value of H_P7_SALESREPIDLIST 2b) CBL_P10_SALESREP has values checked based on the value of H_P10_SALESREPIDLIST (all by default, but a user could change sales reps multiple times) 3) User makes their changes and hits OK 3a) Value of H_P10_SALESREPIDLIST is updated w/ list of currently selected sales reps 3b) Value of H_P7_SALESREPIDLIST is updated w/ the value of H_P10_SALESREPIDLIST 3c) Popup window is closed, returning the user to the report page 3d) TXT_P7_SALESREP is updated via the contents of H_P7_SALESREPIDLIST 4) User runs the report which is processed/displayed based on the values of H_P7_SALESREPIDLIST
I prefer this w / do as little javascript as possible coding, but I understand that it may be necessary.Hmmmm, this is weird @ no alerts
Probably a syntax error in the JS (missing order, quote, brackets etc.)?
CITY
-
Pass parameters using SFWLoader
I need to load a SWF (AS2/AS3) go in an AS3 SWF and pass parameters to the child. It works fine using FlashVars when loading a SWF from JavaScript. Now, I need to do the same thing with a Flex2 SWF file.
I read several posts where people succeed in passing a flex application settings 2 to the SWF, using SWFLoader. I spend a day trying to get this to work but not luck. Read a lot of forum posts and some people claim that it works for them.
The following code is an example. A swf file that loads again all showing the parameters in a label. If you run this in a browser with "test.swf? var1 = hello-world"then it shows well-Hello everyone in the label. Click the load button and it is supposed to load the same swf with another parameter var1. The SWF file loads well but CCET times that the label is empty. The query part of the URL that contains the settings seems to be ignored. What I'm doing wrong here?
Quote:
<? XML version = "1.0" encoding = "utf-8"? >
< mx:Application
xmlns:MX =' http://www.adobe.com/2006/mxml'
verticalAlign = "top".
Width = '100% '.
Height = "100%".
creationComplete = "init ()" "
>
< mx:Label id = "appParmsLabel" text = "parameters of the URI:" / >
< mx:Button label = "Load test.swf? var1 = 123" click = "load1 (); "/ >
< mx:Script > <! [CDATA]
public var SWFURL:String = ' test.swf? var1 = 123;
private function init (): void {}
application.appParmsLabel.text += getAppParms();
}
Get the settings of the application
private function getAppParms (): String {}
var result: String = "";
for (var name: String in application.parameters)
{
name of result += + ': ' + application.parameters [name] + ",";
}
return the result;
}
load swf flash
private void hearings1 (): void {}
Child.source = SWFURL;
}
[]] > < / mx:Script >
< mx:SWFLoader id = "child" / >
< / mx:Application >
-
Don't know if I'm missing something, but should this API show the content type (application/x-www-url-formencoded) when there are values for the p_parm_name and p_parm_value parameters.
The example in the docs is a Yahoo API. I'm not sure that an individual (see: http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_web_service.htm#BABEDJHJ), and I think that it requires an appid (yahoo account), so I went with the example here:
http://developer.Yahoo.com/YQL/guide/YQL-code-examples.html#yql_php
If I run the following from a file html on my desktop, it works:
In other words, it returns a JSON result.<form method="POST" action="http://query.yahooapis.com/v1/public/yql"> <input type="hidden" name="q" value="select * from upcoming.events where location='San Francisco' and search_text='dance'"></input> <input type="hidden" name="format" value="json"></input> <input type="submit"></input> </form>
The raw data of HTTP are as follows:
POST http://query.yahooapis.com/v1/public/yql HTTP/1.1
Host: query.yahooapis.com
Connection: keep-alive
Content-Length: 110
Cache-Control: max - age = 0
Origin: null
User-Agent: Mozilla/5.0 (X 11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11
Content-Type: application/x-www-formulaires-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-, FR; q = 0.8, fr; q = 0.6
Accept-Charset: ISO-8859-1, utf-8; q = 0.7, *; q = 0.3
q = select +upcoming.events+where+location%3D%27San+Francisco%27+and+search_text%3D%27dance%27 & format = json >
However, running the following returns nothing: (nothing, nothing of which depends on the parameters passed in)
Raw data from HTTP:set serveroutput on declare l_c CLOB; begin l_c := apex_web_service.make_rest_request( p_url => 'http://query.yahooapis.com/v1/public/yql', p_http_method => 'POST', p_parm_name => apex_util.string_to_table('q:format'), p_parm_value => apex_util.string_to_table('select * from upcoming.events where location=''San Francisco'' and search_text=''dance'':json'), p_proxy_override => 'http://192.168.1.3:8888'); dbms_output.put_line(substr(l_c, 1, 4000)); end;
POST http://query.yahooapis.com/v1/public/yql HTTP/1.1
Host: query.yahooapis.com
Connection: Keep-Alive
Content-Length: 106
Connection: close
q = 2 Select + % + of + coming % 2Eevents + where + % 3D 'San + Francisco' + and + % 3D search_text 'dance' & format = json >
I note that one key difference is that content type is not defined in the web service API.
It was just to test a public service. I note that the foregoing has slighty different encoding request (percentage of tanks). However, I experienced the same behavior on a procedure that I wrote (I can also give this example of test cases if you wish), which is where I first noticed the issue.
Using utl_http and affecting the type of application/x-www-url-formencoded content, does not solve the problem. However, just thought I'd see the possibility of using the service API Web that is made available.
The example is in the valid docs, or am I missing something obvious?
It's Dev days on ApEx 4.1 on the virtual machine in the RTO.
Thoughts?I had a similar problem:
apex_web_service.make_rest_request packaging missing header parmsI endedup an SR for Oracle to open. I discovered that the headers (content-type) are defined in global variables before calling apex_web_service.make_rest_request.
See http://docs.oracle.com/cd/E17556_01/doc/apirefs.40/e15519/apex_web_service.htm#autoId4 for a description of headers and cookies.
I endedup have to add the following to my code before apex_web_service.make_rest_request:
apex_web_service.g_request_headers (1) .name: = "Content-Type";
apex_web_service.g_request_headers (1) .value: = ' application/xml ';Once I did, my service works. Odd. Not sure why they did it this way because their internal packages use parameters of the header, but the wrappers do this way, I guess.
I hope this works for you!
Jennifer
-
I tried to get the following information in the public domain for years and now that I have the answers, I'll share with those who might be interested.
Caveat!
Wrap your head in tape before reading just for the sake of security.
My two questions were;
(1) may LV re - use tampons of VI calling when you use VI serve call by reference?
(2) is used when the use of call by reference UI thread?
1 when you call a VI using the call through the reference node, the data in the pane of the copied or is node connector - this online as it would be with a Subvi properly implemented?
Short answer: it's somewhere between the two.
Long answer:
The compiler does not know what will be called VI, but there a hint:
the reference connected to the node of the call by reference. He uses to get the 'Prototype' for the call. Therefore, for optimal performance, use a prototype that has the same 'characteristics placeness' as it is called VI. That said, users don't know what are the "characteristics of the placeness.
Before getting into the details, I will say that the overhead of these copies should not matter much unless it's a large data structure (a table with lots of items.) or a cluster/class with many fields or containing large networks etc..
Example 1:
If the prototype does not change the data, then the compiler assumes that the crux of the call by reference will not alter the data. However, at runtime, a check is made to see if the real called VI will modify the data. If Yes, then a copy is made and past so that the original data can be modified.
Example 2:
If the prototype contains an entry that is wired through an exit so that both input and output terminals can use the same buffer memory, but running an audit determines that the real called entry and exit VI do not share a buffer, then a copy will be made from output of the actual call to the original screws (combined input and output) buffer.
I should also mention that, even with this behavior "are trying to get along with the prototype", it is not always possible to obtain good performance as a Subvi ordinary call. For example, if you have a situation where the prototype does not change the data and passes it through to an exit and then the compiler must assume that the data is changed (because, as in example 2, there are screws that may change even if the called real VI is not).
And there are a few caveats:
(1) this behavior "using a prototype" was new for 2009. Before that, we used a method more naïve data of passage that took all the entries will be changed and no outputs don't share a buffer with an entry.
(2) this behavior can be changed in future versions, if we find additional optimizations.
(3) this behavior is the same that we use for the dynamic distribution live (when you use the classes in LV)
(4) If you want to create a VI can be used as a prototype, you can use the features of the Structure in Place to control the "characteristics of the placeness', namely the element nodes in and out of the border, the function"Mark as modifier"border nodes (note the pencil icon on the item), and the node always one copy.
(5) the prototype is only the first reference ever connected to the node of the call by reference. So if you make a new prototype VI, you can just make a reference out of it plug into the crux of the call by reference. I suggest to remove the node from the call by reference and file a new.
(6) for remote calls, we still "making copies" by transmitting data over a network.
I hope that this helps, if you want information/clarification, so feel free to ask.
2 - is the call made by the reference to run in the user interface thread node? If the call is made by a remote machine via ethernet, thread that host (the computer that makes the call by reference) runs on and thread that executes the target (the machine that contains the file VI) on?
In the case of premises, the appeal made by the reference node does not require the user interface thread and may work in some thread the VI wants to run in.
When you call a remote VI, the appeal made by the reference node uses the UI thread (detailed below) on both the client and the server.
The client uses the UI thread to send the request to the server and there still when the response comes back. The user interface thread is not blocked during the time between the two.
The server receives the TCP message in the UI thread, and then starts the call to the UI thread. The server also uses the user interface thread to send the response to the client. The user interface thread is not blocked on the server during execution of the VI.
I hope that people find it when they need it!
Ben
-
Passing parameters to dynamically loaded screws
Hello
I have a data acquisition application that uses an analog input, PCI-Hardware.
With this material I enjoy different channels and display them in audio
In operation 'Preview' I enjoy 4 channels and display them in 4 audios.
I have therefore a quarter of the maximum sampling for each channel.
Operation 'zoom' I only enjoy a channel (at the material max sampling rate)
and display the data in the selected channel (the other channels are igored in zoom mode)My idea is to launch the different screws according to the mode (overview, zooom).
I could imagine, that a good approach to perfom this task calls different screws
of the main program.Unfortunately, I do not understand how to pass parameters to the VI if I call them
using knots "reference open VI", "call for reference" and "close reference VI.
I tried to understand the Labview "Example of dynamic load", but it's too complicated for me.
Can someone give me a simple example to dynamically load the screws or y at - it white papers
or nugets on this topic?
-
Passing parameters using ADR - 404 error
Hi all
I'm all new development APEX. We use the DEPT tables in the sample application oracle provided for practice.
We currently use ADR to pass parameters, but it does not work as expected, or at all. We receive a 404 when you try to run the page.
Objective: User enters number of Department for an article and a 'Change' event (or "lose focus", we have not yet decided) on a dynamic action fills the name field with the name of the service dept.
Has anyone else got this error?
If there is another method recommended, please let me know.
Thanks for your time.
Thanks for the answers, but we have understood the question.
We have changed the JavaScript code as follows:
$.getJSON ("https://apex.oracle.com/pls/apex/mfajertest1/department/"+ $x value ('P2_DEPT_NO'), function (json))
{
Console.log (JSON);
$x('P2_DEPT_NAME').readOnly = false;
$x('P2_DEPT_NAME').value = json.items [0] .dname;
$x('P2_DEPT_NAME').readOnly = true;
$x('P2_DEPT_LOC').readOnly = false;
$x('P2_DEPT_LOC').value = json.items [0] .loc;
$x('P2_DEPT_LOC').readOnly = true;
});
Thanks for the effort.
-
Anyone know how to pass parameters of taskFlow entry in MultitaskFlowBinding?
How to pass parameters of taskFlow entry in MultitaskFlowBinding?
While we might get these within regions in multiTaskFlow Binding input parameters.
Check -http://www.awasthiashish.com/2014/08/create-taskflow-and-region-binding-at.html
Download and view the sample application, it shows how to pass inputParameter using a HashMap for multiTaskFlowBinding
Ashish
-
Passing parameters to the URL - availability in the new process of request
Hello
I am able to pass parameters in the URL of the APEX that defined the points of the application as below
I would like to get and set other items based on elements of application passed as parameters. I would like to only enter once application.
I found the best place for this action in a process of application with Point on new Instance of Process.
The problem seems to be that the value of point of application has not been set at this point, and therefore the values are null.
If I change the application process process Point to something that runs to each page as On Load: after the header, then the values are available. It is not suitable as only wish to run once at startup of the application.
I can't find discussion of this documentation.
1. I would be able to access URL parameters in the application process with Point on a new Instance of the process?
2. are there any other equivalent task for access to URL parameters at the start of the application?
Thank you
Hello
APEX runs only on the new process Instance when a new session has been set up. As you discovered, URL items are not yet saved in session at this point State. You can use a level app process before header instead, with a condition that makes that make it run when certain elements that you want to initialize are null.
Kind regards
Christian
-
Navigation after passing parameters to ADF via URL
How you exit a page after passing parameters via a url as in the method in this link https://blogs.oracle.com/shay/entry/passing_parameters_to_adf_appl?
I tried to drop this delimited task flow on adfc-config and adding a flow of control to another opinion, but I can't seem to access my opinion of this workflow call.
In other words, I can call the workflow bounded through a url and pass it a parameter, but once it is posted I can't go to my other point of view.
How can I do this?
Thank you
If you use a wildcard of navigation in the unlimited workflow as shown here https://tompeez.wordpress.com/2013/06/18/jdeveloper-navigation-after-return-from-bounded-task-flow/
It should work.
Timo
Maybe you are looking for
-
Can I use the print server HP 2101nw Wireless G with my RT Surface? Best regards Martins Vieira
-
So, I'm on Safari on my iPhone. Text fills the search bar on the top of the screen. Is there a way to move to the beginning of the text? Go to end of the text? Or can move forward or backward without deleting the characters? Thanks in advance.
-
Equium A60-199: audio and video control buttons not working not
Audio and video control buttons used to work for windows media player, but now they are not, I wondered if I had pressed or something changed by mistake, or maybe I need to take it to be fixed? Help, please.
-
Subnet to support the customers 900 +.
I have a site that is get about 900 laptops for use on the WIRELESS network. We have just completed the installation of a cisco with a controller 5508 wireless infrastructure. They are all performed in mode local (WLC is on-site) and use a SSID for
-
How can I export views Integrator short 3.1
Hi, I am trying to export views of the Integrator ETL 3.1 according to the standard documentation -http://docs.oracle.com/cd/E40520_01/integrator.311/IntegratorETLUsersGuide.pdf page 88. HHowever, after you run the graph I get the xml output with som