From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to populate 2D array

Hi Alterbach, 

 

I'm back after attempting a simple state machine but I am facing some issues! I keep getting error 66 when I connect my PLC to labview (even without using the button I programmed in the GUI and connecting manually). The VI is attached below. This is the output I've been getting:

 

eenjeruu_0-1670389148652.png

 

In this state machine I am reading "B" instead of A. In the case of B, the PLC will output 5 integer values (5 temperature values in the fuel cell) which are consistent: 40, 50, 55, 56, 66.

 

I tried using the same method with the scan from string - however, it seems to have an error every few seconds which will make the graph toggle from 0 to 40/50/55/56/66 when there is no TCP error. I will be happy to answer more questions that you have regarding this!

 

 

0 Kudos
Message 31 of 38
(647 Views)

As mentioned before, you should "save for previous" before attaching. (2020 or earlier). not many have LabVIEW 2022 installed. Please try again,

0 Kudos
Message 32 of 38
(633 Views)

I am so sorry, it escaped me again! 

0 Kudos
Message 33 of 38
(628 Views)

Ah what a mess! 

 

  • You still have that lone event structure which is completely pointless! Its content could be one of the states instead, right?
  • One clue for the TCP failure would be all these "use default if unwired" output tunnels of the big case structure. For example the TCP connection ID becomes invalid because it is not wired across in the "end" state. So next time you try to read, it will no longer work.

We are missing all subVIs and most typedefs. It would also help to keep the project files neatly organized. Currently, the "save for previous" creates a jungle of folders because you have these long relative paths.

0 Kudos
Message 34 of 38
(607 Views)

@altenbach wrote:

Ah what a mess! 

 

  • You still have that lone event structure which is completely pointless! Its content could be one of the states instead, right?

Yes of course! I left it there just so I don't forget to add it back later which may be bad practice on my end...

 


  • One clue for the TCP failure would be all these "use default if unwired" output tunnels of the big case structure. For example the TCP connection ID becomes invalid because it is not wired across in the "end" state. So next time you try to read, it will no longer work.

We are missing all subVIs and most typedefs. It would also help to keep the project files neatly organized. Currently, the "save for previous" creates a jungle of folders because you have these long relative paths.


I removed the "use default if unwired" and manually wired instead but I still have the same error mostly on the second time it loops... I can take a screen recording of the process (highlight execution) if that helps. I attached an updated file, I hope you have access to the sub-VIs (which I did not create but are probably part of the packages themselves)

0 Kudos
Message 35 of 38
(596 Views)

Hello! I'm back with another probably simple problem. I'm trying to use the scan from string function to get the decimal values of this string sent out by the PLC:
C:0.11,0.22,0.33,0.44,0.55,0.66,0.77,0.88,0.99,1.11,1.22,1.33

 

To do this, I used this expression: C:%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f but it came out as nothing each time. I also tried using %2f, %.2f etc but still the same result.

0 Kudos
Message 36 of 38
(537 Views)

Hi eenjeruu,

 

what have you tried and where are you stuck?

Why don't you attach your current VI showing your efforts?

 

Seems pretty straight forward to me:

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 37 of 38
(517 Views)

Hello GerdW,

 

I just tried a very simple method that works for my other functions but doesn't seem to work with values <0 (i.e. 0.11, 0.22). It works when I do this:

 

eenjeruu_0-1670833671663.png

But does not work when I do this: (which works for other strings, like A:1.00,2.00,3.00 etc)

eenjeruu_2-1670833796425.png

I kinda noticed that this issue (being unable to use C:%f,%f,%f) persists only when the floating point values received from the PLC is <1 as I use scan from string for the other values and they work perfectly fine! 



0 Kudos
Message 38 of 38
(511 Views)