Single string tag expanded into 100 plc register values
I found a way to read 100 registers of plc data with a single string tag, if you can guarantee that none of the plc registers are zero. A register value of zero acts like a Null ascii terminator and truncates the string. Define the string tag as 200 bytes and uncheck the text data only box. Use the code in the attached picture to convert the string bytes back into decimal register values.
Attachments:
string tag to 100 U16 values.gif 2 KB
Ins't that code exactly the same as typecasting to an U16 Array?
Message Edited by altenbach on 05-19-2005 07:24 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
CastingU16.gif 3 KB
Similar Messages
-
Sender File (FCC) - Content of File into single XML Tag
Hi,
Input file
This is Line1
This is Line2
Expected Sender File adapter FCC into XML
<Document>
.<File>
..<Content> This is line 1 This is line2</content>
.</File>
</Document>
FCC is giving the following output with the below config,
File.fieldNames = Content
File.fieldSeparator = '0x1A' (HexaDecimal rep for EndOfFile)
<Document>
.<File>
..<Content>This is line 1</content>
..<Content>This is line 2</content>
.</File>
</Document>
How can i read the complete file into a single XML tag?
I am aware of other options (AdapterModules or Javamapping). But i want to keep it simple to FileAdapter using FCC or using MessageTransformBean (if possible)
-SMFCC donse't work here, So i wrote a simple Java map inside Execute method to convert the content to the required format.
public void execute(InputStream in, OutputStream out) throws StreamTransformationException{
StringBuilder sb = new StringBuilder();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
while ((line = reader.readLine()) != null) {
sb.append(line).append("\r\n");
} finally {
in.close();
After i had the input string, i formatted it to get the required output as XML ...
<Document>
.<File>
..<Content> This is line 1 This is line2</content>
.</File>
</Document> -
Convert the IDOC XML file into single string?
Hello All,
I have a scenario, where i need to conver the IDOC XML into single string, to send it to target.
Please let me know how can we achive this, I dont know java coding.
Please help me out to write the java code.
Thanks and Regards,
ChinnaHi Chinna,
You can do this in two ways -
1. Java mapping
https://wiki.sdn.sap.com/wiki/display/XI/JavaMapping-ConverttheInputxmlto+String
https://wiki.sdn.sap.com/wiki/display/Snippets/JavaMapping-ConverttheInputxmltoString
2. XSLT mapping
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
Regards,
Sunil Chandra -
Convert an array of strings into a single string
Hi
I am having trouble trying to figure out how to convert an array of strings into a single string.
I am taking serial data via serial read in a loop to improve data transfer. This means I am taking the data in chunks and these chunks are being dumped into an array. However I want to combine all elements in the array into a single string (should be easy but I can't seem to make it work).
In addition to this I would also like to then split the string by the comma separator so if any advice could be given on this it would be much appreciated.
Many Thanks
Ashley.Well, you don't even need to create the intermediary string array, right? This does exactly the same as CCs attachment:
Back to your serial code:
Why don't you built the array at the loop boundary? Same result.
You could even built the string directly as shown here.
Message Edited by altenbach on 12-20-2005 09:39 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
autoindexing.png 5 KB
concatenate.png 5 KB
StringToU32Array.png 3 KB -
Concatenate fields on multiple child rows into one single string
Hi -
I'm pretty much new to BI Publisher, and I looked through the forums for what I was trying to do below, but couldn't find much on this.
Here's my data source:
<BUSINESSES>
<BUSINESS>
<NAME>Microsoft</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Apple</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Google</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Yahoo</NAME>
</BUSINESS>
</BUSINESSES>
What I was trying to do is create a single string from the XML data source in the form
Microsoft,Apple,Google,Yahoo,............
Here was my plan to do this:
1. Create a global variable - <?variable:AllNames;''?>
2. Loop - For each BUSINESS
2a. Capture NAME - <?variable@incontext:BusName;'NAME'?>
2b. Concatenate it to the global variable AllNames - <?variable:AllNames;concat($AllNames,',',$BusName)?>
3. End Loop
4. Display global variable - <?$AllNames?>
I get a blank RTF when I run this.
Can someone please advice me on this? I thought it would be pretty simple to do, but here i am at the end of the day, and ...
Thank you.There are multiple ways to do it..
one option of using variable, which i would not certainly do is this :)
<?xdoxslt:set_variable($_XDOCTX,'TESTTEST’,’’)?>
<?for-each:/BUSINESSES/BUSINESS?>
<?position()?>: <?NAME?> <?xdoxslt:set_variable($_XDOCTX,'TESTTEST’, concat(xdoxslt:get_variable($_XDOCTX,'TESTTEST’),’,’ ,NAME) )?>
<?end for-each?>
<?xdoxslt:get_variable($_XDOCTX,'TESTTEST’)?> -
XML document convert into String and Insert into Database
Hello all,
In the FIle to File Scenario I want to send the data to the Reciever System in xml Document and convert into String and insert into Database.
Please can you tell me exact way how to send it.
Thanks & Regards,
RajHI,
As per my understanding your scenario is File to file where you will get output fiel in XML format.
Now that XMl payload need to be passed as single string in the database via XI.
You cauld do this but you need to imply some manipulations such as
With the help of standard API you need to concatenate the XML tags and create the structre along with the data.
For e.g. in your outpuf file the XML structre contain data as
<field1>ABCD</field1>
Then in mapping
The source field will be mappeda s concat(<field1>) + value of Source field "ABCD" + concat(</field1>) to the target field.
This is the way that you could achive the requirments else there is no direct way avaialble for it.
thanks
Swarup -
Need to insert rows into 100 tables at a time
hi there,
below is our script for creation of 100 tables...
we need a plsql script, to insert rows into 100 tables at a single time...
please help us...vey urgent...
DECLARE
counter NUMBER;
sql_string VARCHAR2(2000);
BEGIN FOR counter IN 1..100 LOOP sql_string := 'CREATE TABLE emp_table'||counter||'
(id integer primary key, col_a VARCHAR2(42),col_b date,col_c number,col_d varchar2(20),col_e varchar2(20),
col_f varchar2(20),col_g varchar2(20),col_h date,col_i varchar2(20),col_j varchar2(20),col_k date)';
EXECUTE IMMEDIATE sql_string;
END LOOP;
END;
/hi,
below is our procedure and the error we are getting...
Name Null? Type
ID VARCHAR2(10)
COL_A VARCHAR2(10)
COL_B VARCHAR2(10)
COL_C VARCHAR2(10)
COL_D VARCHAR2(10)
COL_E VARCHAR2(10)
COL_F VARCHAR2(10)
COL_G VARCHAR2(10)
COL_H VARCHAR2(10)
COL_J DATE
DECLARE
counter NUMBER;
sql_string VARCHAR2(4000);
BEGIN FOR counter IN 1..100 LOOP sql_string := 'CREATE TABLE emp_a'||counter||'
(id varchar2(10), col_a varchar2(10), col_b varchar2(10), col_c varchar2(10), col_d varchar2(10), col_e varchar2(10),
col_f varchar2(10), col_g varchar2(10), col_h varchar2(10), col_j date)';
EXECUTE IMMEDIATE sql_string;
END LOOP;
END;
DECLARE
counter NUMBER;
sql_string VARCHAR2 (2000);
BEGIN
FOR OuterCounter IN 1 .. 100 LOOP --- table prefix in which it is to be inserted
FOR InnerCounter IN 1 .. 100 LOOP --- records to be inserted
sql_string := 'INSERT INTO emp_a' || Outercounter || ' (id, col_a, col_b, col_c, col_d, col_e, col_f, col_g, col_h, col_j)
VALUES ('
|| InnerCounter || ', to_char( ''col_a''' || innercounter || '),'
|| InnerCounter || ', to_char( ''col_d''' || innercounter || '),'
|| ', to_char( ''col_e''' || innercounter || '),'
|| ', to_char( ''col_f''' || innercounter || '),'
|| ', to_char( ''col_g''' || innercounter || '),'
|| ', to_char( ''col_h''' || innercounter || '),'
|| ', to_char( ''col_j''' || innercounter || '), SYSDATE)';
EXECUTE IMMEDIATE sql_string;
END LOOP;
END LOOP;
END;
DECLARE
ERROR at line 1:
ORA-00907: missing right parenthesis
ORA-06512: at line 17
please check the procedure and write the correct one... -
How to get the tag name into javascript
Hi,
Is there any way to get the tag name into java script when user clicks on.
For eg: if i use netui:anchor tag, how can I pass the tag id to the javascript when user clicks on the link using onClick attribute. This tag id needs to be evaluated at run time.
Ex code is given below.
function fun1(){
// how to get the tag name;
<%
String st="hai";
%>
<netui:anchor action="x" onClick="fun1()" tagId="<%=st%>>
I want to get this tagId (st) to the java script function fun1() when user clicks on this link. How can I do that. can you please help in this issue.
Thanks,
Satish.Hi,
You can set the java variable as a js variable at run time:
<script>
var anchorName = <%=getNetuiTagName%>;
function fun1()
var anchorID = getNetuiTagName(anchorName);
alert(anchorID);// this will show the rendered ID for the anchor specified
</script>
this works because the jsp variable will be rendered before the js.
Thanks,
Steve -
Convert Inputstructure into String and store into DB2
Hello All
My requirement is I want to convert total input structure into string then stored into database single field as clob. Can anyone suggest me how will i retive input structor, is there any user defined function will i write or is there any inbuilt functionality in SAP PI. Plese suggest me
Thanks&Regards,
VenkatKHi Swarup / Shamly
My input structure is nearly 60 fields. Sample Structure
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<create xmlns="urn:MySoapServices">
<PurchaseOrder>
<BuyerDetails>
<Organization>University of Washington</Organization>
<Authorized_Person>
<FisrtName>Cease</FisrtName>
<LastName>Wayne</LastName>
</Authorized_Person>
<Street>Savery Hall</Street>
<City>Seattle</City>
<State>Wa</State>
<Zip>98195</Zip>
<Contact_Numbers>
<Phone>888-846-6638</Phone>
<Fax>212-629-1158</Fax>
</Contact_Numbers>
<Email>hidekiu.washington.edu</Email>
</BuyerDetails>
<SupplierDetails>
<Organization>Thomas Industrial Network</Organization>
<Authorized_Person>
<FisrtName>Cease</FisrtName>
<LastName>Wayne</LastName>
</Authorized_Person>
<Street>5 Penn Plaza, 10th Floor</Street>
<City>New York</City>
<State>NY</State>
<Zip> 10001</Zip>
<Contact_Numbers>
<Phone>888-846-6638</Phone>
<Fax>212-629-1158</Fax>
</Contact_Numbers>
</SupplierDetails>
<PurchaseOrderInformation>
<Order_Number>4556</Order_Number>
<Order_Delivery_Date>10-10-2006</Order_Delivery_Date>
<PO_Type>Finished</PO_Type>
<status>PO sent</status>
</PurchaseOrderInformation>
<Address>
<Shipping_Address>
<Organisation>University of Washington</Organisation>
<Authorized_Person>
<FisrtName>Cease</FisrtName>
<LastName>Wayne</LastName>
</Authorized_Person>
<Street>Savery Hall</Street>
<City>Seattle</City>
<State>Wa</State>
<Zip>98195</Zip>
<Email>hidekiu.washington.edu</Email>
</Shipping_Address>
<Billing_Address>
<Organisation>University of Washington</Organisation>
<Authorized_Person>
<FisrtName>Cease</FisrtName>
<LastName>Wayne</LastName>
</Authorized_Person>
<Street>Savery Hall</Street>
<City>Seattle</City>
<State>Wa</State>
<Zip>98195</Zip>
<Email>hideki</Email>
</Billing_Address>
</Address>
<Payment_Terms>
<Purchase_Order>
<PO_Number>456</PO_Number>
<Payment_Type>Bank</Payment_Type>
<Payment_Type_PO>
<Bank>
<BankName>Citibank</BankName>
<AccountNumber>654987456</AccountNumber>
<BranchCode>564</BranchCode>
</Bank>
<Credit_Card>
<Payment_Type_CC>VISA</Payment_Type_CC>
<CC_Number>1234 4567 7890 0123</CC_Number>
<CC_Expire_Date>10-12-2012</CC_Expire_Date>
</Credit_Card>
</Payment_Type_PO>
</Purchase_Order>
<Currency>USD</Currency>
</Payment_Terms>
<Purchase_Items>
<Item>
<Part_Name>6 foot wide 5 foot high cabinet</Part_Name>
<Quantity>9</Quantity>
<Description>Cabinets of systems</Description>
</Item>
<Item>
<Part_Name>6 foot wide shelves</Part_Name>
<Quantity>6</Quantity>
<Description>Shelves for books</Description>
</Item>
</Purchase_Items>
</PurchaseOrder>
</create>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I need to store whole XML structure (Including XML version) into Database single field as a clob. not field values. Please help me out from this issue. -
Multiple strings input to single string output
Dear all,
this program is needed for my demo simulation purposes, I'm creating several string inputs to show into a single string output updating (input strings are shown in each line). i attached the picture below, put 2 output strings w/c both doesn't meet my desired result:
1.) 1st string output - replace the old string w/ new string. what i need is to maintain also the previous strings. the new string will go to the next line.
2.) 2nd string output - although i got all the strings i needed, it only appears right after the while loop terminates, so i did not see the string inputs updating.
i'm using LV 8.5.1., any help is appreciated... posting your correct code will be more appreciated.
thanks in advance...
Ivel R. | CLAD
Solved!
Go to Solution.here's my code for anyone to see the actual difference.
thanks,
Ivel R. | CLAD
Attachments:
update strings.vi 14 KB -
I am designing an invoice report. There are some controls at the top of the report (company logo, date, invoice number etc), followed by a table listing the items in the invoice, followed by some controls at the bottom (subtotals, returns address etc). The report should always print onto a single page.
I want the controls at the bottom to have a fixed position on the page. There is sufficient whitespace between these controls and the table above for the table to expand to list many items. However whenever it expands it pushes the lower controls down. This results in them spilling onto a second page.
Is there a way to fix the position of controls and suppress the "gets pushed down when controls above expand" effect?Thanks for that. I found a good solution using rectangles here: SQL Server 2005: Report Design Best Practices and Guidelines
Here's the relevant part (see underlining):
Using Rectangles to Keep Objects Together
Rectangles in Reporting Services can be used either as graphical elements or as containers of objects. As object containers, they keep objects together on a page and control how object move and push each other.
To keep multiple objects together on a page, put the objects within a rectangle. You can then put a page break before or after the rectangle by using the PageBreakAtStart or PageBreakAtEnd properties for the rectangle.
Using Rectangles to Control Item Growth and Displacement
Items within a rectangle become peers of each other and are governed by the rules of how peer items are positioned on the page as they move or grow. For example:
Items will push or displace each other within the rectangle.
Items will not push or displace items outside the rectangle, because they are not their peers.
If necessary, a rectangle will grow to accommodate the items it contains.
You can use this logic to your advantage when dealing with objects that expand. For example:
If you want to leave a blank space in your report for a table to expand into, group the blank space and the table in the same rectangle. When the table grows, it will push the blank space .
If you want to prevent a matrix from pushing items off the right edge of the page, put the matrix within a rectangle with blank space to its right. Now, the matrix is no longer a peer to the other item on the page and will not be able to push it until the matrix can no longer be contained within its rectangle. -
Is there a way in Oracle to return multiple rows as a single string?
Hi gurus,
I just got help from your guys fixing my dynamic sql problem. What I am doing in that function is to return a single string from multiple rows and I use it in the select statement. It works fine once the problem was solved. But is there any way in Oracle to do this in the select statement only? I have a table that stores incidents (incident_id is the PK) and another table that stores the people that are involved in an incident.
Incident_table
(incident_id number PK);
Incident_people_table
(incident_id number PK/FK,
person_id number PK);
Now in a report, I need to return the multiple rows of the Incident_People_table as a single string separated by a comma, for example, 'Ben, John, Mark'. I asked the SQL Server DBA about this and he told me he can do that in SQL Server by using a variable in the sql statement and SQL Server will auomatically iterate the rows and concatenate the result (I have not seen his actual work). Is there a similar way in Oracle? I have seen some examples here for some similar requests using the sys_connect_by_path, but I wonder if it is feasible in a report sql that is already rather complex. Or should I just stick to my simpler funcion?
Thanks.
BenHi,
May be, this example will help you.
SQL> CREATE TABLE Incident_Table(
2 incident_id number
3 );
Table created.
SQL> CREATE TABLE Person_Table(
2 person_id number,
3 person_name VARCHAR2(200)
4 );
Table created.
SQL> CREATE TABLE Incident_People_Table(
2 incident_id number,
3 person_id number
4 );
Table created.
SQL> SELECT * FROM Incident_Table;
INCIDENT_ID
1
2
SQL> SELECT * FROM Person_Table;
PERSON_ID PERSON_NAME
1 John
2 Mark
3 Ben
4 Sam
SQL> SELECT * FROM Incident_People_Table;
INCIDENT_ID PERSON_ID
1 1
1 2
1 3
2 1
2 2
2 4
6 rows selected.
SQL> SELECT IT.*,
2 (
3 WITH People_Order AS (
4 SELECT IPT.incident_id, person_id, PT.person_name,
5 ROW_NUMBER() OVER (PARTITION BY IPT.incident_id ORDER BY PT.person_name) AS Order_Num,
6 COUNT(*) OVER (PARTITION BY IPT.incident_id) AS incident_people_cnt
7 FROM Incident_People_Table IPT
8 JOIN Person_Table PT USING(person_id)
9 )
10 SELECT SUBSTR(SYS_CONNECT_BY_PATH(PO.person_name, ', '), 3) AS incident_people_list
11 FROM (SELECT * FROM People_Order PO WHERE PO.incident_id = IT.incident_id) PO
12 WHERE PO.incident_people_cnt = LEVEL
13 START WITH PO.Order_Num = 1
14 CONNECT BY PRIOR PO.Order_Num = PO.Order_Num - 1
15 ) AS incident_people_list
16 FROM Incident_Table IT
17 ;
INCIDENT_ID INCIDENT_PEOPLE_LIST
1 Ben, John, Mark
2 John, Mark, SamRegards,
Dima -
In the tag configuration I can select for a string tag, but I do not see a way to set up the Lookout Protocal Driver for a string tag.
That's right - The old IAK/IAS Servers from National Instruments were a tighten developement with BridgeVIEW together - so that they implement the string data type. Since NI recommends to use the LPD drivers instead of the IAK Servers there is no way to configure string tags in the Lookout protocol drivers. The LPDs or Lookout does not really handle arrays/strings at all - that's a limitation for the Lookout protocol drivers.
Roland -
Is it not possible to give the select single field without an into clause
Hi,
i have to check whether my input value( only one filed) is available in the table.
for eg i need to check whether company code is available in the table t001.
then i will give .
data lv_bukrs type t001-bukrs.
lv_bukrs = 1010.
select single bukrs from t001 where bukrs = lv_bukrs.
here its asking for me to give a vaible to store the bukrs that is
select single bukrs into dummyvalue from t001 where bukrs = lv_bukrs.
Is it not possible to give the select single fieldname without an into clauseIts Possible by declaring the tables statement
<b>tables : AFKO.
select single * from AFKO where <condition>.</b>
If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used. The addition ORDER BY can also not be used.
An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering.
Notes
When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key.
If accessing tables for which SAP buffering is planned for single records, the SAP buffer is bypassed if the addition SINGLE is not specified. This behavior depends on the current implementation of the database interface and may change in future releases. In particular, it should not be used to bypass the SAP buffer. You should use the explicit addition BYPASSING BUFFER for this instead.
The addition SINLGE is not permitted in a subquery.
Regards
- Gopi -
Concate mutiple input in to Single String.
Hi ,
I need one help .
I want to contcat the one of the IDOC fields occurance in a single string. Please let me know how to user.
For Ex. I am mapping one field of Idoc ex TDLINE --> Extrinsic (0.. Unbounded)in the output side.
In the Input side the TDLINE fields appears multiple time. in the current mapping I have one to one mapping between TDLINE and Extrinsic fields. So it creates the same number of Extrinsic fields as I have TDLINE fields at input side.
What I want to do , I want to create a single Extrinisc fields at output side for all the TDLINE fields.
For Ex. At particaular segment I have 10 fields for TDLine then all should come as Single string at out put side.
Note . No of Occurance of TD line is 0.. unbounded).
Please give ur suggestions for the same.Hi Ram,
i got same problem recently. For this problem there is no standard functions in XI so you must create udf. I wrote that udf and sending with these:
http://allyoucanupload.webshots.com/v/2003800853095440083
http://allyoucanupload.webshots.com/v/2003854577844519372
http://allyoucanupload.webshots.com/v/2003865357113273227
http://allyoucanupload.webshots.com/v/2003828767547920796
Regards,
Sai
Maybe you are looking for
-
Report on Total U/R stock and Open PO quantity
Dear Friends, Is there any standard report or table which gives the present unrestricted usage stock and Open purchase order stock for all materials in a storage location or material group as selection instead of single material. If we can have open
-
After upgrade my computer does not recognize my ipod
i tried to upgrade my OS on my ipod touch and it is no longer recognised by my computer
-
How do I leave delete all of my emails in one account
How do I delete all of the email in one single account? I have three accounts on my iPad.
-
hi gurus I installed ECC 60ssr2.after installation i configured post installations.next what are the corresponding parameters we need to increase for buffer performance(sto2) and workload statistics(sto3). please send documentation of para
-
How to respond to delete key in JTree
How do you catch key events in a JTree or any Java component for that matter ?