Thanks for your reply,
I made changes based on your suggestions.
At first, only the sections before connecting to the device worked, but when I try to run it afterwards, Labview always crashes.
Below is the sample code that I have corrected.
hikvision 5.vi