The limit for the number of frames in a sequence is only limited by your computer's system memory. With that said, there is a Maximum number of Buffers parameter that you must set in MAX. It's under the Tools>>NI-IMAQ menu and I believe it defaults to 50. You can set this number to whatever you want (mine is set to 1000, even though I don't have that much system memory).
Once you've set the value, then it's just a matter of having enough RAM. Another factor that you may have to consider is time. If you're trying to save images in real-time (30 frames per second for example), then this code will probably go too slowly. Converting an image into a 2D array, then flattening it into a pixmap before saving it to disk can take time. What kind of saving rate are
you trying to achieve? What's the data rate?
One way to just trouble shoot the frames issue is to not bother saving to disk just yet. Instead, run the HL Sequence example that ships with NI-IMAQ.
Good Luck!
Kyle V