LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bad type case Error in DVR

Solved!
Go to solution

Hi All,

 

I m facing an issue when using DVR. My code snippet is given below

DVR Issue.PNG

 

As shown in the block diagram, I used two different methods for DVR write and Read which are L1&L2 and L3&L4

L1 and L2 is working as expected.

I m getting an error from L3&L4, which is bad type case error (error 1448)

 

Here I have a class called "Data" and under data I have the child classes , like "SGL Array","Boolean Array" and etc

There is a Communication class and DVR class is inherited from communication class

 

Can anyone suggest what could be the problem in L3&L4. why is it behaving differently when it is inside a member class VI. I have the same code inside the member class vi which is highlighted in red color rectangle.

 

Thank you

Vipinraj KK Certified LabVIEW Architect

0 Kudos
Message 1 of 10
(3,518 Views)

Can't debug a picture.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 10
(3,487 Views)

@paul_cardinale wrote:

Can't debug a picture.


Exactly - what's happening in the subvis is where the issue is, and they obviously aren't just what you have outlined as what is in them.

0 Kudos
Message 3 of 10
(3,445 Views)

Dear Paul,

 

Thanks for your reply,

 

Please find the attached code (DVR Test.7z) . Kindly review the same.

 

Vipinraj KK  Certified LabVIEW Architect

0 Kudos
Message 4 of 10
(3,395 Views)

Something is wrong with your .7z file.  I get an error when trying to open it.  Something about an unsupported command.

 

Please attach a real zip file and not a .7z file. 

0 Kudos
Message 5 of 10
(3,383 Views)

Hi,

 

Please find the attachment in .zip format

0 Kudos
Message 6 of 10
(3,379 Views)

In loop L4, you are trying to cast the output of "Communication.lvclass:Read Data Out.vi" to "SGL Array.lvclass".  However at runtime, it does not contain a "SGL Array.lvclass", it contains "Data.lvclass" so the "To More Specific Class" must fail.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 10
(3,346 Views)

But same logic is working in Loop 2

0 Kudos
Message 8 of 10
(3,341 Views)
Solution
Accepted by VipinrajKK

This is why using error IO is always helpful - you've got a bug in your DVR start method - you're not wiring the output of the DVR write accessor to the output class, so neither loop 3 nor loop 4 is using a valid DVR. After fixing this, both setups work.

 

 

Message 9 of 10
(3,313 Views)

Great!

 

I Didn't connect that.

 

Thanks a lot.

0 Kudos
Message 10 of 10
(3,295 Views)