Importing/exporting a CSV file
jan
Posts: 3
How can I import/export CSV file from/to Netlinx master??
0
Comments
You mean like using FTP? Filezilla is ideal but you can also use NetLinx Studio File Transfer.
If you mean in some programmed automated way, be more specific on what you are trying to do...
A client called me for an assistance. He wants to change the label/name of the buttons (for lighting control) on a touch panel. But the names/labels are on the CSV files. See below module part. I am new on this and I need some guidance. Thanks in advance
MODULE_NAME='Module__Lutron_ZonenMgmt,Rev 1'(DEV vdv_Lutron_ZonenMgmt)
(***********************************************************)
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
//-----------------------------------------------------
// >> Lutron_ZonenMgmt KONSTANTEN <<
//-----------------------------------------------------
CHAR cLutron_ZonenMgmt__CSV_PATH[] = 'Lutron_ZonenMgmt'
CHAR cLutron_ZonenMgmt__CSV_FILE[][50] = {
'Lutron_SzenenMgmt.csv',
'Lutron_LichtMgmt.csv',
'Lutron_StorenMgmt.csv',
'Lutron_VorhangMgmt.csv',
'Lutron_ZonenMgmt.csv',
'Lutron_WetterAlarmeMgmt.csv'
}
(* Die Namen, welche in der EXCEL Liste in der Formatierung <XXXX hinterlegt sind, hier eintragen! )
CHAR cLutron_ZonenMgmt__ZONE_CMD_NAME[][20] = {
( Excel Scenen Management *)
'KNXSCENE',
'KNXSCENEORT',
'KNXSCENENAME',
//-----------------------------------------------------
// >> Lutron_ZonenMgmt KONSTANTEN <<
//-----------------------------------------------------
(***********************************************************)
(* DATA TYPE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_TYPE
//-----------------------------------------------------
// >> Lutron_ZonenMgmt STRUCTURE DATENBANK <<
//-----------------------------------------------------
//==> NEU: Structure DB ist im Handling definiert
// Befehle werden mittels Send_String abgesetzt
//-----------------------------------------------------
// >> Lutron_ZonenMgmt STRUCTURE DATENBANK <<
//-----------------------------------------------------
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE
//-----------------------------------------------------
// >> Lutron_ZonenMgmt VARIABLEN <<
//-----------------------------------------------------
VOLATILE CHAR cLutron_ZonenMgmt__CSV_BUFFER[499999] //CSV Einlese buffer
VOLATILE CHAR bLutron_ZonenMgmt__ActivateDiagnostic = TRUE //Diagnostik aktivieren
VOLATILE INTEGER nLutron_ZonenMgmt_ReadNextCSV
//-----------------------------------------------------
// >> Lutron_ZonenMgmt VARIABLEN <<
//-----------------------------------------------------
(***********************************************************)
(* LATCHING DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_LATCHING
(***********************************************************)
(* MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_MUTUALLY_EXCLUSIVE
(***********************************************************)
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
(***********************************************************)
//__ Sende an Diagnostik __
DEFINE_CALL'Lutron_ZonenMgmt__Diagnostic'(CHAR cStringTxt[])
{
IF(bLutron_ZonenMgmt__ActivateDiagnostic) SEND_STRING 0,"'#[Lutron_ZonenMgmt] --> ',cStringTxt"
}
//__ CSV File Lutron_ZonenMgmt auslesen (select) __
DEFINE_CALL'Lutron_ZonenMgmt__ReadCSV'(INTEGER nLutron_Group) //1=Szenen CSV, 2=Licht CSV, 3=Storen CSV, 4=Vorhang CSV, 5=ZonenMgmt CSV, 6=WetterAlarme CSV
{
STACK_VAR SLONG slFileOpenResult
STACK_VAR SLONG slFileReadResult
STACK_VAR SLONG slFileCloseResult
STACK_VAR SLONG slSetDirResult
For clarity, are you saying the only goal here is to alter the text on touch panel buttons that presently is based on the name of an internal variable corresponding to actual file names?
Yes
You can extract the file that needs to be edited through any FTP client - I use boring old Windows File Explorer more than anything else. Once the file is edited same applies for loading the file back to the master.
https://digitalcitizen.life/connect-ftp-server-windows-explorer
If you use Filezilla there’s protocol config that needs to be made on their FTP client, DOS modes or something, I’m not at my PC know so I can’t look and see.
If you only want to alter button text, this isn't about import/export at all. It's about understanding dynamic touch panel design and management, sending text to display on buttons.
WinSCP is the best for all your file transfer needs. Just make sure to set the protocol to FTP when you connect to the netlinx master.