Efficient method to save data to disk in RT?
What options are available to read data from a buffer and save it to the hard disk drive in RT? What method requires the least processor overhead...or perhaps can be set to run in the background without any processor intervention at all?
In Traditional NI-DAQ 7.0, buffered analog input (a la AI Read.vi) uses DMA to transfer points from an E-Series board to a software buffer on the PC. The uP doesn't have to intervene for this to occur thanks to DMA. However, the uP does have to read from the software buffer and write the points to disk.
In a real-time scenario, we generally recommend that customers acquire the data in their time-critical VI and then pass the data to a normal priority VI using RT FIFOs (shipping in 7.0, otherwise available on the web). The RT FIFOs are non-blocking queues that are expressly designed for moving data from a time-critical VI to a lower priority VI safely.
Acquired data would thus follow a path like this:
E-Series -> PC software buffer ->
time-critical VI in LabVIEW -> normal priority VI in LabVIEW -> disk
The first transfer from board to software buffer uses DMA and happens transparently to the user. The second transfer occurs within AI Read or AI Singlescan. Third transfer you must program using RT FIFOs. Last transfer you must program with File I/O VIs.
Similar Messages
-
I am currently using LV6.1.
My host program is currently using Datasocket to read and write data to and from a Field Point 2010 system. My controls and indicators are defined as datasockets. In FP I have an RT loop talking to a communication loop using RT-FIFO's. The communication loop is using Publish to send and receive via the Datasocket indicators and controls in the host program. I am running out of bandwidth in getting data to and from the host and there is not very much data. The RT program includes 2 PID's and 2 filters. There are 10 floats going to the Host and 10 floats coming back from the Host. The desired Time Critical Loop time is 20ms. The actual loop time is about 14ms. Data is moving back and forth between Host and FP several times a second without regularity(not a problem). If I add a couple more floats each direction, the communications goes to once every several seconds(too slow).
Is there a more efficient method of transfering data back and forth between the Host and the FP system?
Will LV8 provide faster communications between the host and the FP system? I may have the option of moving up.
Thanks,
ChrisChris,
Sounds like you might be maxing out the CPU on the Fieldpoint.
Datasocket is considered a pretty slow method of moving data between hosts and targets as it has quite a bit of overhead assosciated with it. There are several things you could do. One, instead of using a datasocket for each float you want to transfer (which I assume you are doing), try using an array of floats and use just one datasocket transfer for the whole array. This is often quite a bit faster than calling a publish VI for many different variables.
Also, as Xu mentioned, using a raw TCP connection would be the fastest way to move data. I would recommend taking a look at the TCP examples that ship with LabVIEW to see how to effectively use these.
LabVIEW 8 introduced the shared variable, which when network enabled, makes data transfer very simple and is quite a bit faster than a comparable datasocket transfer. While faster than datasocket, they are still slower than just flat out using a raw TCP connection, but they are much more flexible. Also, the shared variables can fucntion in the RT fifo capacity and clean up your diagram quite a bit (while maintaining the RT fifo functionality).
Hope this helps.
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing -
Save data to a table (In the View method)
Hi,
I am new to Webdynpro.We have a requirement in BW to update user config tables using webdynpro.I got the retrieve data part working.
Now I am trying to save data back to the table.I got the following code in the save method which will be called when the save button is clicked.
method ONACTIONSAVEDATA .
data:
TABLE_NODE type ref to IF_WD_CONTEXT_NODE,
varTable type standard table of ZUSRCONFIG.
TABLE_NODE = WD_CONTEXT->GET_CHILD_NODE( 'TABLE_N1' ).
endmethod.
How can I get the data from the TABLE_NODE so that I can use a update command subsequently.TABLE_NODE in the context is bound to ZUSRCONFIG table.
Thankshi siva...
here is the code :
DATA lo_nd_node_table TYPE REF TO if_wd_context_node.
DATA lo_el_node_table TYPE REF TO if_wd_context_element.
DATA ls_node_table TYPE wd_this->element_node_table.
navigate from <CONTEXT> to <NODE_TABLE> via lead selection
lo_nd_node_table = wd_context->get_child_node( name = wd_this->wdctx_node_table ).
@TODO handle not set lead selection
IF lo_nd_node_table IS INITIAL.
ENDIF.
get element via lead selection
lo_el_node_table = lo_nd_node_table->get_element( ).
@TODO handle not set lead selection
IF lo_el_node_table IS INITIAL.
ENDIF.
alternative access via index
lo_el_node_table = lo_nd_node_table->get_element( index = 1 ).
@TODO handle non existant child
IF lo_el_node_table IS INITIAL.
ENDIF.
get all declared attributes
lo_el_node_table->get_static_attributes(
IMPORTING
static_attributes = ls_node_table ).
ls_node_table will containe the values of your table.
---regards,
alex b justin -
Efficient method to insert large number of data into table
Hi,
I have a procedure that accepts an input parameter, that contains, a comma seperated values as input.
Something like G12-UHG,THA-90HJ,NS-98039,........There can be more than 90,000 values in that comma seperated input paramter.
What is the most efficient way to do an insert in this case?.
3 methods I have in mind are :
1) Get individual tokens from CSV and use a plain old loop and do an insert.
2) Use BULK COLLECT & FOR ALL. However I don't know how to do this, since input is not from cursor, rather a parameter.
3) Use Table collections. Again this involves plain old looping through the collection. Same as 1st method.
Please do suggest the most efficient method.
Thanks90,000 values?? Whats the data type of the input parameter?
you can use the string to row conversion trick if you want and do a single insert
SQL> with t as (select 'ABC,DEF GHI,JKL' str from dual)
2 select regexp_substr(str,'[^,]+', 1, level) list
3 from t connect by level <= NVL( LENGTH( REGEXP_REPLACE( str, '[^,]+', NULL ) ), 0 ) + 1
4 /
LIST
ABC
DEF GHI
JKL Edited by: Karthick_Arp on Feb 13, 2009 2:18 AM -
Save Data in ALV Report .
Hello,
Given below is my code
*& Report ZALV_TEST_SA *
REPORT ZALV_TEST_SA NO STANDARD PAGE HEADING.
*----------------------TYPE POOL OF ALV--------------------------------*
TYPE-POOLS: SLIS.
*----------------------DATABASE TABLES---------------------------------*
TABLES: ZFLIGHTM_SA, ZFLIGHT_AVAIL_SA.
*-------------DATA DECLARATION-----------------------------------------*
DATA: BEGIN OF ITAB OCCURS 0,
ZFLIGHT_ID TYPE ZFLIGHT_ID,
ZCITY_FROM TYPE ZCITY_FROM,
ZCITY_TO TYPE ZCITY_TO,
ZDEP_DATE TYPE DATS,
ZTIME TYPE TIMS,
ZPRICE TYPE ZPRICE,
ZNUM_OF_PSNGRS(3) TYPE N,
ZAVAIL_SEATS(3) TYPE N,
END OF ITAB.
DATA: BEGIN OF ITABM OCCURS 0,
MANDT TYPE MANDT,
ZFLIGHT_ID TYPE ZFLIGHT_ID,
ZCITY_FROM TYPE ZCITY_FROM,
ZCITY_TO TYPE ZCITY_TO,
ZTIME TYPE TIMS,
ZPRICE TYPE ZPRICE,
END OF ITABM.
DATA: BEGIN OF ITAB_AVAIL OCCURS 0,
MANDT TYPE MANDT,
ZFLIGHT_ID TYPE ZFLIGHT_ID,
ZDEP_DATE TYPE DATS,
ZNUM_OF_PSNGRS(3) TYPE N,
ZAVAIL_SEATS(3) TYPE N,
END OF ITAB_AVAIL.
DATA: WA_ITAB LIKE LINE OF ITAB,
WA_ITABM LIKE LINE OF ITABM,
WA_ITAB_AVAIL LIKE LINE OF ITAB_AVAIL.
DATA: L_REPID LIKE SY-REPID,
L_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV,
L_EVENTS TYPE SLIS_T_EVENT.
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
*----------------SELECTION SCREEN SELECT-OPTIONS-----------------------*
SELECT-OPTIONS S_CITY FOR ZFLIGHTM_SA-ZCITY_FROM NO INTERVALS.
SELECT-OPTIONS D_CITY FOR ZFLIGHTM_SA-ZCITY_TO NO INTERVALS.
SELECT-OPTIONS D_DATE FOR ZFLIGHT_AVAIL_SA-ZDEP_DATE NO INTERVALS.
*----------------------SELECTION OF DATA-------------------------------*
PERFORM SELECT_DATA.
*----------------SETTING DATA IN TABLE FOR FIELD CATALOG---------------*
PERFORM CALL_FIELDCAT_MERGE.
*----------CALLING FUNCTION FOR DISPLAYING REPORT----------------------*
PERFORM DISPLAY_TABLE.
*----------------------AT SELECTION SCREEN EVENT-----------------------*
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'STORE'.
PERFORM SAVE_DATA.
WHEN 'PREVIOUS'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
*------------------------------FORMS-----------------------------------*
*& Form SELECT_DATA
* text
* --> p1 text
* <-- p2 text
FORM SELECT_DATA .
SELECT A~ZFLIGHT_ID ZCITY_FROM
ZCITY_TO ZDEP_DATE
ZTIME ZPRICE
ZNUM_OF_PSNGRS ZAVAIL_SEATS
FROM ZFLIGHTM_SA AS A INNER JOIN ZFLIGHT_AVAIL_SA AS B
ON A~ZFLIGHT_ID = B~ZFLIGHT_ID
INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE A~ZCITY_FROM IN S_CITY
AND A~ZCITY_TO IN D_CITY
AND B~ZDEP_DATE IN D_DATE.
L_REPID = SY-REPID.
ENDFORM. " SELECT_DATA
*& Form CALL_FIELDCAT_MERGE
* text
* --> p1 text
* <-- p2 text
FORM CALL_FIELDCAT_MERGE .
* CLEAR WA_FIELDCAT.
* WA_FIELDCAT-TABNAME = ITAB.
* WA_FIELDCAT-FIELDNAME = 'ZFLIGHT_ID'.
* WA_FIELDCAT-KEY = 'X'. "sets key field
* APPEND WA_FIELDCAT TO L_FIELDCAT.
* WA_FIELDCAT-TABNAME = ITAB.
* WA_FIELDCAT-FIELDNAME = 'ZPRICE'.
* WA_FIELDCAT-KEY = 'X'. "sets key field
* APPEND WA_FIELDCAT TO L_FIELDCAT.
* WA_FIELDCAT-TABNAME = ITAB.
* WA_FIELDCAT-FIELDNAME = 'ZAVAIL_SEATS'.
* WA_FIELDCAT-KEY = 'X'. "sets key field
* APPEND WA_FIELDCAT TO L_FIELDCAT.
*--------------CALLING FUNCTION FOR FIELD CATALOG----------------------*
CLEAR L_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = L_REPID
I_INTERNAL_TABNAME = 'ITAB'
* I_STRUCTURE_NAME = 'WA_ITAB'
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = 'ZALV_TEST_SA'
I_BYPASSING_BUFFER = 'X'
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = L_FIELDCAT
* EXCEPTIONS
* INCONSISTENT_INTERFACE = 1
* PROGRAM_ERROR = 2
* OTHERS = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--------------EDITING FIELDS IN FIELD CATALOG ------------------------*
LOOP AT L_FIELDCAT INTO WA_FIELDCAT.
CASE WA_FIELDCAT-FIELDNAME.
WHEN 'ZFLIGHT_ID'.
WA_FIELDCAT-COL_POS = '1'.
* WA_FIELDCAT-text_fieldname = 'Flight ID'.
WA_FIELDCAT-KEY = '3'.
WA_FIELDCAT-JUST = 'L'.
WA_FIELDCAT-NO_ZERO = 'X'.
WA_FIELDCAT-EMPHASIZE = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Flight ID'. "40 char long field name
WA_FIELDCAT-SELTEXT_M = 'Flight ID'. "20 char long field name
WA_FIELDCAT-SELTEXT_S = 'Flight ID'. "10 char long field name
WHEN 'ZCITY_FROM' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZCITY_TO' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZDEP_DATE' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZTIME' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZPRICE' .
WA_FIELDCAT-COL_POS = '2'.
* WA_FIELDCAT-text_fieldname = 'Flight ID'.
WA_FIELDCAT-KEY = '4'.
WA_FIELDCAT-JUST = 'L'.
WA_FIELDCAT-NO_ZERO = 'X'.
* WA_FIELDCAT-EMPHASIze = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Price'. "40 char long field name
WA_FIELDCAT-SELTEXT_M = 'Price'. "20 char long field name
WA_FIELDCAT-SELTEXT_S = 'Price'. "10 char long field name
WA_FIELDCAT-EDIT = 'X'.
WHEN 'ZNUM_OF_PSNGRS' .
WA_FIELDCAT-NO_OUT = 'X'.
WHEN 'ZAVAIL_SEATS' .
WA_FIELDCAT-COL_POS = '3'.
* WA_FIELDCAT-text_fieldname = 'Flight ID'.
WA_FIELDCAT-KEY = '4'.
WA_FIELDCAT-JUST = 'L'.
WA_FIELDCAT-NO_ZERO = 'X'.
* WA_FIELDCAT-EMPHASIze = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Available Seats'.
"40 char long field
WA_FIELDCAT-SELTEXT_M = 'Available Seats'.
"20 char long field
WA_FIELDCAT-SELTEXT_S = 'Seats'. "10 char long field name
WA_FIELDCAT-EDIT = 'X'.
WHEN OTHERS.
WA_FIELDCAT-NO_OUT = 'X'.
ENDCASE.
MODIFY L_FIELDCAT FROM WA_FIELDCAT.
ENDLOOP.
ENDFORM. " CALL_FIELDCAT_MERGE
*& Form USER_COMMAND_ALV_SA
* text
* --> p1 text
* <-- p2 text
FORM USER_COMMAND_ALV_SA USING I_UCOMM LIKE SY-UCOMM
IS_SELFIELD TYPE SLIS_SELFIELD.
*****form frm_usercommand using r_ucomm like sy-ucomm
*****rs_selfield type slis_selfield.
****CASE I_UCOMM.
CASE sy-ucomm.
WHEN 'STORE'.
PERFORM SAVE_DATA ON COMMIT.
WHEN 'PREVIOUS'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
ENDFORM. "USER_COMMAND_ALV_SA
*& Form DISPLAY_TABLE
* text
* --> p1 text
* <-- p2 text
FORM DISPLAY_TABLE .
* L_FIELDCAT-input = 'X'.
* L_FIELDCAT-edit = 'X'.
* L_LAYOUT-Edit = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = L_REPID " report id
I_CALLBACK_PF_STATUS_SET = 'ZALV_TEST_SA' " to set pf-status
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_ALV_SA' " to handle
" user command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME = ''
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = L_FIELDCAT " for field catalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = L_EVENTS "internal table with
" user events
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB "internal table with
" records
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
********* IF SY-SUBRC <> 0.
********** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
********** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
********* ENDIF.
ENDFORM. " DISPLAY_TABLE
*-------------------------SET PF-STATUS--------------------------------*
*& Form ZALV_TEST_SA
* text
* --> p1 text
* <-- p2 text
FORM ZALV_TEST_SA USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ZALV_TEST_SA' .
ENDFORM. "ZALV_TEST_SA
*& Form SAVE_DATA
* text
* --> p1 text
* <-- p2 text
FORM SAVE_DATA.
LOOP AT ITAB INTO WA_ITAB.
****HIDE:WA_ITAB-ZFLIGHT_ID, WA_ITAB-ZCITY_FROM,
****WA_ITAB-ZCITY_TO, WA_ITAB-ZTIME,
****WA_ITAB-ZDEP_DATE, WA_ITAB-ZNUM_OF_PSNGRS,
****WA_ITAB-ZAVAIL_SEATS.
CLEAR: WA_ITABM,WA_ITAB_AVAIL.
WA_ITABM-ZFLIGHT_ID = WA_ITAB-ZFLIGHT_ID.
WA_ITABM-ZCITY_FROM = WA_ITAB-ZCITY_FROM.
WA_ITABM-ZCITY_TO = WA_ITAB-ZCITY_TO.
WA_ITABM-ZTIME = WA_ITAB-ZTIME.
WA_ITABM-ZPRICE = WA_ITAB-ZPRICE.
WA_ITAB_AVAIL-ZDEP_DATE = WA_ITAB-ZDEP_DATE.
WA_ITAB_AVAIL-ZNUM_OF_PSNGRS = WA_ITAB-ZNUM_OF_PSNGRS.
WA_ITAB_AVAIL-ZAVAIL_SEATS = WA_ITAB-ZAVAIL_SEATS.
APPEND WA_ITABM TO ITABM.
APPEND WA_ITAB_AVAIL TO ITAB_AVAIL.
ENDLOOP.
MODIFY ZFLIGHTM_SA FROM TABLE ITABM.
MODIFY ZFLIGHT_AVAIL_SA FROM TABLE ITAB_AVAIL.
COMMIT WORK.
ENDFORM. " SAVE_DATA
I want to edit a field--the price and save the changes. I have assigned a button STORE for this. But my data is not getting saved.
I searched the forum and wrote the code accordingly. I even referred the stored programs. Still I am not getting the output. Please help.
Regards,
Smruthi.
Edited by: Smruthi Acharya on Feb 10, 2009 3:31 PM
Edited by: Julius Bussche on Feb 10, 2009 12:16 PM
Please use code tagsHi,
You must have taken some function code for that STORE button (say you have taken it as MODIFY )
Use this code, it will modify the code in internal table from alv.
I have tried it, n its working:-
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = v_rep_id " report id
i_callback_pf_status_set = 'PF' " for PF-STATUS
i_callback_user_command = 'USER_COMMAND' " for User-Command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = wa_layout " for layout
it_fieldcat = it_field " field catalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort " sort info
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* i_save = 'A'
* is_variant = wa_variant " variant name
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final " internal table
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form USER_COMMAND
* SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
* AND EXECUTE THE APPROPIATE CODE
* -->LV_OKCODE used to capture the function code
* of the user-defined push-buttons
* -->L_SELFIELD text
FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
* assign the function code to variable v_okcode
lv_okcode = sy-ucomm.
* handle the code execution based on the function code encountered
CASE lv_okcode.
* when the function code is MODIFY (STORE button) then save data
WHEN 'MODIFY'.
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
" at this point your data in internal table is changed
* refresh the ALV Grid output from internal table
l_selfield-refresh = c_check.
ENDFORM. "USER_COMMAND
Hope this helps you.
Regards,
Tarun -
Hi,
I want to save data in Excel? But how?
Can somebody send me a VI?
Thank youIf you want to do excel formatting and really have full functionality in Excel without having to buy the reports toolkit, you can use the Excel ActiveX controls. If you have Excel installed you can use ActiveX references to do anything you want excel to do for you. Use an automation reference and select the Excel class. I forget what its called, but you should be able to find what does what without too much problem. You just use methods from the reference. It takes a bit of work to figure out what everything does, but I have written huge formatting vi's that open excel, format cells, run macros, and save files in excel and then close excel when its done. It all depends on how fancy you want to get.
-Devin
I got 99 problems but 8.6 ain't one. -
How to save data in a string control?
I want to save data in a string control or indicator. I know that I can rt-click and make the data default. But can it be done through a proberty node or something else when the program is running?
There isn't a "Make Current Value Default" method that you can invoke programmatically, this would require your VI to be saved when it was closed, which obviously couldn't be done if it had been built into an executable.
You could read the values from the controls/indicators and save them in a .ini file using the Configuration File VIs on the File I/O palette, and have some code at the start of your program that reads the values from the file and puts them into the objects using local variables. -
Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory
Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it.
Alex D
Applications Engineer
National Instruments -
Best Method for Saving Data to File?
Hi,
We're using labVIEW 2009 to acquire data from our instrument. In the past we have used the "write to labview measurement file" express configuration tool to save data to a file. However we had some issues with our VI - occasionally we would lose data or column headers somewhat erratically and were never able to sort out the problem. We would like to rewrite our VI with the best possible solution.
Here's a summary of what we would like to do:
Save 30 variables at a rate of roughly 1 Hz. We would like one set of column headers per file so that the data can be easily imported into labVIEW with the variable names intact. We will be collecting data continuously, so we would like to divide the data into 3-4 files per day. Ideally, the program to start new files at the same times from day to day and the filename could be configured to include the date and time/file number.
I am hoping that users can provide a little feedback about methods that were most successful and reliable. From what I have read there are a few different ways to do this (express VI, tdms, "write to text file"). Any thoughts or relevant examples would be quite useful for us!
Thanks for your help!Meg T wrote:
Is it correct to say that in your method, the indexing results in building up the data into one large array of data before saving it to the file with the column headers and filenames appended? If we are writing data at 1Hz for 6 hours of time, will we run into an issue being able to store all the data?
Yes the indexing will build up one large array. If this is a problem due to array size and memory, you will have to write more often. You can write every second, that should not be a problem. You should still write the column names to the file first, and have the append input set to False (or nothing wired in since the default is false). This will create a new file with the headers only. Then the data write has a True wired in so that the append takes place. If running for 6 hours and gathering data once per second, your array will contain 36,006 rows of data. I'm not sure if that would cause a memory problem or not.
Meg T wrote:
it also seems difficult to incorporate headers into express VI if you are writing the data continuously as a part of a loop with the "append" option.
If you write the headers before the loop as I have shown, and use append inside the loop, you will not have problems.
- tbob
Inventor of the WORM Global -
Form created in ES4 won't save data entered in acrobat readerXI
I have created a large form in Live Cycle Designer ES4. If I save the form as a pdf and open it in Acrobat Reader XI I get the message that I cannot save data entered in the form only print it. All I want to do is to put the form on our web site for people to download, complete, save and e-mail it back to me. I did consider an alternative method which is if I distribute the form and take the distributed pdf and save it locally, when it is opened in Reader you get the submit button on teh purple bar on teh right hand side. This will confuse a lot of our users so if there is a way to not have the submit button then that would work but how do I stop the submit button appearing on the purple bar?
You have to Reader-enable the form. You can do this in Acrobat 11 by opening the form in Acrobat and selecting: File > Save As Other > Reader Extended PDF > Enable More Tools
Reader 11 can save non-enabled AcroForms (forms created in Acrobat), but not non-enabled XFA forms (forms created in LiveCycle Designer). -
Efficient Technique to Insert Data in Table ???
Hi
I want to implement the best efficient technique to insert data in Table. I have rows counts in millions in one db and I want to insert them in to another db with least time.
>>
I am implementing the technique of reading data from first db, apply some logics on it, insert the data in the log file (log4j) in the tab and line separated format and after completing the process insert log file data into the final table (using mysql load data local infile).
>>
Another technique that I use is to directly insert data into the final table after reading it from first db and applying logics on it.
>>
Another technique that I am going to use is using the JDBC Batch Update i.e. updating around (say 1000) rows in a final table after reading and applying logics on it.
Bench Marks:
The first technique takes 2 minutes for 60,000 rows
The second technique takes 4.5 minutes for 60,000 rows
The third technique is not implemented yet
Do anyone have any other technique to implement this working in more efficient way?
Regards
Rizwan Ahmed (rizzz86)When optimizing JDBC code, there are several things you should look into:
* use batch statements (reducing the number of roundtrips is really important!)
* disable autoCommit and commit() on your own (reducing the number of roundtrips and the number of disk accesses on the DB server)
* use PreparedStatements (avoid parsing the same statement again and again)
Those three should buy you quite a bit of time.
Edit: if it's still too slow (and only then!) you can look at the documentation of your JDBC driver. Sometimes there are options that can be enabled to speed things up (MySQL is especially bad here: there are some advanced features that are disabled by default, just because older server releases don't support them. I don't understand why they arent enabled conditionaly.). -
How to save data to access database in dreamweaver
Hello,
I want to save data from webpage to MS access database. I am
using dreamweaver MX 2004 developing tool. For server side
scripting I am using asp page but I am not geting any result. And I
am calling this asp page using HTML codes (using "action").
Please anybody suggest me proper way for this.Thanks for the reply....I'will try your suggestion
........But still I will appriciate if you can check my codes......
I am using following codes for webpages,
<form name="form1" action="add_to_database.asp"
method="post">
<div align="center">
<table width="80%" border="0">
<td><b>FEEDBACK FORM</b></td>
<tr> <td>Name :</td>
<td><input type="text" name="uname"></td>
</tr>
<tr>
<td>Email :</td>
<td> <input type="text" name="email"></td>
</tr>
<tr>
<td>Comments :</td>
<td><textarea
name="comments"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Submit details"
name="submit" onClick="validate()" ></td>
</tr>
</table>
</div>
</form>
and using the action and post method I am calling following
asp page
<body>
<%
Dim uname, email, comments
Dim Conn
Dim Rs
Dim sql
uname = Request.Form("uname")
email = Request.Form("email")
comments =Request.Form("comments")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=" & Server.MapPath("users.accdb")
sql= "INSERT into adduser(uName, Email, Comments) values(' "
& uname & "', '" & email & "', '" & comments
Conn.execute sql
Rs.Open sql, Conn
Rs.AddNew
Rs.Fields("Name") = Request.Form("name")
Rs.Fields("Email")=Request.Form("email")
Rs.Fields("Comments") = Request.Form("comments")
Rs.Update
Rs.Close
Set Rs = Nothing
Set Conn = Nothing
%>
</body>
Thanks, -
Using TDM VI in Lv 7.1 to stream data to disk
I found the TDM VI and the structure of the data is very interesting for my application.
I try to use it to stream an array of waveform data but the TDM VI goes very slow.
after that, I see in the documentation that TDM file can't support streaming to disk, but I think it's really a basic function.
futhermore,the TDM VI write binary data, so normally it must work !.
is there another possibily with TDM file to stream data to disk ?
Thanks in advance for your help.
GHELEYNS Nicolas
Phénix Industries s.a.Hi,
The LabVIEW Storage VIs do not yet support streaming data to disk. However, you can benefit from the storage VIs structured approach to saving data by:
Streaming data to disk using standard binary write VIs
Reading data back in and writing it back out to disk using the storage VIs after acquisition
Deleting the original binary file
Although there is the extra step of writing data to an intermediate binary file, you benefit because you can structure your data and save it with the descriptive properties that the storage VIs offer.
Regards.
JorisV -
Save Data From Grid to Database
Hello All,
I want to create a form to save data from a grid to the database just like the SAP Forecast Form .
My requirements are as follows :-
I have created a Table in which there are three fields ItemCode,Date,Qty
But while entering user will first select the Date ranges (from - To) and based on that date range
no. of columns will be created as it will be dynamic and then user will enter the corresponding quantity for that item and date
just like the Sales Forecast (SAP) Form .
Form will be like :-
From Date - 10/10/11 ToDate - 13/10/11
Row Levels Fields :-
ItemCode 10/10/11 11/10/11 12/10/11 13/10/11
A0001 100 150 200 300
While updating system will put the data in database table as :-
ItemCode Date Quantity
A0001 10/10/11 100
A0001 11/10/11 150
A0001 12/10/11 200
A0001 13/10/11 300
This is what i want to do .
Please suggest how to proceed with this using a Matrix or a grid.
Thanks & Regards,
Amit
Edited by: AmitSharma_061985 on Oct 19, 2011 7:08 AMHi,
If you are doing it with oops concept then here are the steps for that.
1) Declare DATA : er_data_changed TYPE REF TO cl_alv_changed_data_protocol,
data_changed TYPE REF TO cl_alv_changed_data_protocol.
--For getting the row no of of the row which is edited by user
DATA : ls_mod_cell TYPE table of lvc_s_modi with header line,
lv_value TYPE lvc_value .
in your program
2) Define a class
CLASS notification DEFINITION.
PUBLIC SECTION.
CLASS-METHODS : handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
ENDCLASS. "NOTIFICATION DEFINITION
3) For that class write the implementation
CLASS notification IMPLEMENTATION.
METHOD handle_data_changed.
PERFORM handle_data_changed USING er_data_changed.
ENDMETHOD. "handle_data_changed
ENDCLASS. "NOTIFICATION IMPLEMENTATION
4) In the PERFORM handle_data_changed you code like this
FORM handle_data_changed USING er_data_changed type ref TO
cl_alv_changed_data_protocol.
SORT er_data_changed->mt_mod_cells BY row_id .
LOOP AT er_data_changed->mt_mod_cells
INTO ls_mod_cell .
append ls_mod_cell.
ENDLOOP.
*LS_MOD_CELL will have all the rows which were edited
and all the updated data corresponding to those rows*
You can now use the the data which is in LS_MOD_CELL
to update into your DB Table.
LOOP at ls_mod_cell.
READ TABLE itab3 INTO t_output INDEX ls_mod_cell-row_id.
ENDLOOP.
ENDFORM. " handle_data_changed
Regards,
Syed -
IFRAME into iMOVIE - most efficient method for importing?
What would be the most efficient method for importing iFrame movies from a camera into iMovie?
iFrame i suppose to save time and work more efficiently in lue of quality but I don't seem to find I way to import the movies faster than in other formats.
On a second note, inporting in iMovie from DV (tape) cameras dramaticly reduced the image quality. Do we still have the same issue when importing an iFrame movie?
Thank you for your help!Im completly new myself to importing IFRAME into Imovie 11 as i only got my new Panasonic X920 Camcorder 2 days ago.Can you please tell me is there a big drop in quality from 1080 60p to IFRAME Quality.
Maybe you are looking for
-
Hi, I have one big xml file which looks like this: <Parameters> <previous> <business> <id>1234</id> <name>Business Customer</name> </business> <location> </location> </previous> <current> <business> <id>12345</id> <name>Business Customer Changed</nam
-
Problem with strobe image in FCP
Hi, I am currently editing with footage that uses strobe lighting on the subject. At times, I cannot view the strobe image as it can't seem to handle displaying one frame of picture, as this is the amount of time that the strobe lights for. I tried t
-
Could this be the reason "only" about 100 CUDA cores are utilized?
Could it be because of a tradeoff in quality vs speed? The more you rely on CUDA the more quality suffers? CUDA transcode quality compared with Intel's Quick Sync: http://www.anandtech.com/show/4083/the-sandy-bridge-review-intel-core-i5-2600k-i5-2500
-
Question I want to install Google Toolbar for Firefox, but this is availaible only for Firefox 4. Can I replace My Firefox 6 with this older one Firefox 4, please?
-
Refer to mxml component within the same package
Hello How can I refer to the same mxml component both of which live in the same package? For example, I have myHbox and myTabNav in the same package named ui. I am already referring to the myHBox mxml class in the Application class through the line