Showing results for 
Search instead for 
Did you mean: 

Bad type case Error in DVR

Go to solution

Hi All,


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



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

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

@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

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

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



Please find the attachment in .zip format

0 Kudos
Message 6 of 10

In loop L4, you are trying to cast the output of "Communication.lvclass:Read Data" 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

But same logic is working in Loop 2

0 Kudos
Message 8 of 10
Accepted by topic author 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



I Didn't connect that.


Thanks a lot.

0 Kudos
Message 10 of 10