3/16/2016 4:47 PM | |
Joined: 3/14/2008 Last visit: 11/11/2024 Posts: 2126 Rating: (951) |
Hi Berg, There is a block called: "R_I" FC106 in the CFC library. The input is a REAL and is converted to a INT. Or do you need a REAL output? For the conversion of TIME, I don't think there is a block available. In this case you have to develop a SCL code (preferably).
|
Last edited by: Oreca at: 3/16/2016 4:54:17 PMIf I could help you, you can use the RATE button. Thank you. |
|
3/17/2016 8:52 AM | |
Joined: 3/14/2008 Last visit: 11/11/2024 Posts: 2126 Rating: (951) |
Berg, I think you have to develop the block yourself with SCL (Default programming language for PCS7). Please let me know if you need help with that. |
If I could help you, you can use the RATE button. Thank you. |
|
This contribution was helpful to1 thankful Users |
3/17/2016 9:22 PM | |
Joined: 3/14/2008 Last visit: 11/11/2024 Posts: 2126 Rating: (951) |
Hello Berg, Well, I made you a SCL source which is attached and also a print screen of the block in test mode. You now have a REAL input and a REAL output which is truncated. Also, the input is converted to the "TIME" format which outputs a time. I notice in your last post that you do not have experience in SCL programming? I will list down the procedure on how to use this in your project. SCL is the default programming language for PCS7 to create user block types of which you can also use in WinCC. 1. You have to input the source to your source folder preferably at your master library and distribute then to your project(s). Or just to your project if you do not have a master lib. Go to your SOURCE folder and right click->Insert new object->External source and select the source I gave you. 2. In your symbol table (master lib. or project) create a new symbol called: "R_TO_TIME", This is the name of your function block, which is in the SCL source. You have to give in a FB number. Use a FB number above 2500 because of the standard Siemens FB blocks. 3. Open the source and compile the source + save. (Compile button is the left icon under "View"). A block type is now generated according to the source file. You can now use this block in your program. 4. Open a CFC chart where you want to insert the block and select from your "S7_program" library the block. (S7_program is the default name of your AS program folder). 5. Compile+download AS I already gave the "Output" the attribute: S7_m_c, which means you can use this variable in WinCC and use it to display the time. For your information, the S7_dynamic attribute is used to see the actual values in test mode (values have yellow color). Hope this is what you want! AttachmentReal_To_Time.zip (174 Downloads) |
If I could help you, you can use the RATE button. Thank you. |
|
This contribution was helpful to1 thankful Users |
3/18/2016 3:05 PM | |
Joined: 3/14/2008 Last visit: 11/11/2024 Posts: 2126 Rating: (951) |
Hi Berg, Well, when you change an attribute, create a new variable, delete a variable and few others, you will need a full download.. However, if you have a CPU410 and PCS7 8.1 or above, you will be able to download in run if a block type interface changes. Its called TCiR. But I have a good tip: When you really need to change the block type and a stop is not possible, then you can make a copy of the source, change the FB name from "R_TO_TIME" to something else and create a new FB number in the symbol table with the new name. Compile the source and exchange the old block with the new block. Only the downside is that if you have 100instances, you need to do this 100 times |
If I could help you, you can use the RATE button. Thank you. |
|
This contribution was helpful to1 thankful Users |
Follow us on