LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass an array of strings? (Help Me... Please!!! .Read Me....)

Dear All.

 

Help Me...

 

English is not very good. Google translator is used.

 

 How do I pass an array of strings?

 

Please refer to the VB program

  

 ===========================================
Private Sub m_btn_Click()
    Dim nReturn As Long
    Dim sPpid As String
    Dim sMdln As String
    Dim sSoftRev As String
    Dim nCount As Long
    Dim saCCodes(2) As String
    Dim naPCount(2) As Long
    Dim saPNames(10) As String


    sPpid = "PPID001"
    sMdln = "Mdln"
    sSoftRev = "Rev001"
    nCount = 2
    saCCodes(0) = "1"
    naPCount(0) = 5
    saPNames(0) = "Param001"
    saPNames(1) = "Param002"
    saPNames(2) = "Param003"
    saPNames(3) = "Param004"
    saPNames(4) = "Param005"

    saCCodes(1) = "2"
    naPCount(1) = 5
    saPNames(5) = "Param006"
    saPNames(6) = "Param007"
    saPNames(7) = "Param008"
    saPNames(8) = "Param009"
    saPNames(9) = "Param010"

    nReturn = m_XGem.GEMReqSend(sPpid, sMdln, sSoftRev, nCount, saCCodes(0), naPCount(0), saPNames(0))
    If (nReturn = 0) Then
        Call Me.AddMessage("[EQ ==> XGEM] GEMReqSend successfully")
    Else
        Call Me.AddMessage("[EQ ==> XGEM] Fail to GEMReqSend (" & nReturn & ")")
    End If
End Sub

=================================================

 

 

nCount, naPCount enough saCCodes, saPNames value must be sent.

  

 

How to handle an array of strings in LabView is impatient.

 

I want to VB program implemented in LabView.

 

0 Kudos
Message 1 of 7
(3,409 Views)

Hi,

 

you handle an array of strings the same way as an array of numbers Smiley Wink

There are a lot of functions in the Array palette!

 

Please be more specific on what you're trying to do.You want to pass an array, but what's the target?

And you don't need to cry in the thread topic!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,406 Views)

Array of String to send.PNG

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 7
(3,395 Views)

Sounds like you need to read some of the LV tutorials:

 

http://zone.ni.com/devzone/cda/tut/p/id/7571

 

http://www.medicollector.com
0 Kudos
Message 4 of 7
(3,381 Views)

EXGemVB.JPG

 

 

psCCode, pnParamCount, psParamNames is StringArray.

 

The first pointer to an array of string values I want to pass.

 

In the first string of EXGemVb GEMRspPPmt should proceed with an array value.

 

VB program, the value of the results is attached.

 

EXGemVB-1.JPG

 

0 Kudos
Message 5 of 7
(3,349 Views)


GEMReqPPFmtSend is a description.
===================================

GEMReqPPFmtSend (sPpid As String, sMdln As String, sSoftRev As String, nCount As Long, psCCode As String, pnParamCount As Long, psParamNames As String) As Long

Parameters

Name ,               Type         desc
======================================
sPpid ,               String ,     Process Program ID
sMdln,               String,      Equipment Model Type
sSoftRev ,          String ,     Software Revision
nCount,             Long,        CCode Array of Count
psCCode,          String,      CCode Array of the first Item pointer
pnParamCount,  Long,        ParamCount Arrayof first the Item pointer
                                         Parameter in the CCode gaesuim each ParamCount
psParamNames,  String,      ParamName Array pointer of the first Item
                                         ParamName the ParamCount Array of Array Size Total number of information is the sum of all.
=======================================

0 Kudos
Message 6 of 7
(3,329 Views)

Have you actually tried to right click on the according node parameter and select Create->Constant or Create-Control??

 

And I don't see any string array in the parameter list. That are all simple strings and the VB code in your first post clearly shows that the call to the function only indexes the first element of those arrays to be passed to the function, not the entire array.

 

If the function really reads arrays despite being declared as only taking strings then it is using some weirdo VB trickery and there will be no way to replicate that in LabVIEW.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 7
(3,324 Views)